-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
Call WebApplication.CreateBuilder(args) only once #34492
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
aspnetcore/fundamentals/configuration/index.md:63
- [nitpick] The sentence could be rephrased for clarity: 'Although this article mentions
WebApplication.CreateBuilder(args)
multiple times, application code should call this method only once.'
> While this article mentions `WebApplication.CreateBuilder(args)` many times, application code should call this method only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overreaction to one customer and too much bling. I'd change it to:
Do a search on WebApplication.CreateBuilder(args)
, all the code samples show it's only called once. This is not a recurrent problem.
NOTE:: WebApplication.CreateBuilder(args)
should only be called once.
The 2nd time you call it
var builder = WebApplication.CreateBuilder(
you get a compiler error.
I'm not sure I'd even need a warn. We can't overreact to every error a customer makes and spam the topic with warnings.
> [!IMPORTANT] | ||
> While this article mentions `WebApplication.CreateBuilder(args)` many times, application code should call this method only once. For more information, see [this IIS Support blog post](https://techcommunity.microsoft.com/blog/iis-support-blog/asp-net-core-503-server-has-been-shutdown/3830338). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> [!IMPORTANT] | |
> While this article mentions `WebApplication.CreateBuilder(args)` many times, application code should call this method only once. For more information, see [this IIS Support blog post](https://techcommunity.microsoft.com/blog/iis-support-blog/asp-net-core-503-server-has-been-shutdown/3830338). | |
Note: `WebApplication.CreateBuilder(args)` should only be called once. |
Fixes #34216
Internal previews