Skip to content

Docs for members in DependencyInjection.Abstractions lack exception information. #108024

@ericstj

Description

@ericstj

Description

I heard feedback that folks felt the docs for AddSingleton lacked good information about when it would fail and why.

I took a look and I agree. It seems that whenever we have a method with a corresponding Try method, we should be sure to include the exception docs. That will help folks if they need to use the Try method always, or if they would prefer to just use the non-try method for simpler code and treat the exception case as an invalid configuration.

Reproduction Steps

Have a look at docs https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicecollectionserviceextensions.addsingleton?view=net-8.0

Expected behavior

Information about meaningful thrown exceptions exists.

Actual behavior

No information exists

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions