Skip to content

Conversation

@cincuranet
Copy link
Contributor

Fixes #53831.

@cincuranet cincuranet self-assigned this Jan 27, 2026
@cincuranet cincuranet added this to the 11.0.0 milestone Jan 27, 2026
@cincuranet cincuranet marked this pull request as ready for review January 27, 2026 08:58
@cincuranet cincuranet requested a review from a team January 27, 2026 08:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the XML documentation for the AddHostedService extension methods to clarify that these methods only register the service as IHostedService in the DI container, not as the concrete type itself. This addresses confusion reported in issue #53831 where developers expected the concrete type to also be registered.

Changes:

  • Added <remarks> sections to both overloads of AddHostedService explaining the registration behavior
  • Included code examples demonstrating the workaround pattern for registering both the concrete type and the hosted service

@cincuranet cincuranet merged commit ccf3932 into dotnet:main Jan 30, 2026
89 checks passed
@cincuranet cincuranet deleted the hostedservice-docs branch January 30, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AddHostedService does not register specified Type Parameter in DI container

3 participants