Skip to content

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

@ghost ghost 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

4 participants