Skip to content
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

Prevent 503s from IIS after IISNativeApplication gets finalized #59910

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

halter73
Copy link
Member

This was brought to my attention by dotnet/AspNetCore.Docs#34492, but @Tratcher had already filed an issue for it. Both of these are based on the investigation at https://techcommunity.microsoft.com/blog/iis-support-blog/asp-net-core-503-server-has-been-shutdown/3830338.

@Tratcher's suggestion was to detect this situation and provide a better error, but so long as we haven't actually started the server, I don't think this needs to be an error case at all. We could consider making the server restartable, but I think that would require more drastic changes, and that's not something people try to do often.

What's more common is code like the following:

var config = WebApplication.CreateBuilder().Configuration;
var someConfig = config["someConfig"];

While I would never recommend this, and would advocate for creating your own ConfigurationManager or ConfigurationBuilder from the appropriate source instead, this should not break IIS.

Fixes #48457

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jan 17, 2025
@halter73 halter73 merged commit dd9550a into main Jan 17, 2025
27 checks passed
@halter73 halter73 deleted the halter73/48457 branch January 17, 2025 20:26
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detecting IIS 503s caused by multiple host instances
3 participants