-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI is running all registered IHostedService #2712
Comments
Related: dotnet-getdocument issues in .NET7 on the ASP.NET Core repository. The workaround I describe there requires modifying the application code so your pull request is probably a much better approach! I'm just a bit worried that this project looks currently inactive. Last commit and last comment from @domaindrivendev dates back to January, 11. In the meantime, issues and pull requests are piling on. 😕 I hope this is only temporary. 🤞 |
This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made. |
Thanks for your help with this - the fix is available in Swashbuckle.AspNetCore 6.6.2. |
Currently the CLI is running all registered Hosted Services (
IHostedService
). I see that it's needed to start the application because otherwise theapp.Use*
/app.Map*
configuration is not run. Because it's starting the application (with a NoopServer) it is running all registered HostedServices.Because the CLI is almost always run in the context of a build it would be nice to not run those registered hosted services. This would also solve instances of for example HangFire or other things which start an IHostedService.
I've got a fix which I would like to discuss. It's a bit dirty but it works in my tests.
The text was updated successfully, but these errors were encountered: