Skip to content

Blazor Web App - IIS - App shutdown on refresh - HTTP Error 503.0 - Server has been shutdown #57707

Open
@kuldeepcis-lab

Description

@kuldeepcis-lab

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm using the .NET 8 Blazor web app template, which includes both a client and server project. In the server project, I have an API controller that I call using HttpClient. When running the application on Kestrel (using commands like dotnet run or dotnet projectassembly.dll), everything works as expected. However, when I deploy the application to either a local or remote IIS, or run it via Visual Studio on IIS, the site starts but fails after requesting the Web API controllers. It returns a 503 error for all requests, and the application becomes unresponsive with no indication of what went wrong.

Expected Behavior

The application should work smoothly and get data from database on API calls and don't shut down on refresh or Api calling.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to repository and clone BlazorWebappOidc and Open the application in Visual Studio.
  2. Add an IIS Settings to launchsettings.json to run the application on IIS locally then Run
    "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:46294", "sslPort": 44381 } },"profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } }
  3. Add an API controller to server project and add a couple of method to get data from database.
  4. Register HTTPClient at client side project to call the API.
  5. lets run the project on the IIS profile and try to fetch data via method we have added into API controller this will return response Error 503 Shut down or just refresh the page it will show the error.

Exceptions (if any)

No response

.NET Version

DOTNET 8

Anything else?

For reference What I am getting on the browser please see the images.

Screenshot_15
Screenshot_16

cc: @guardrex dotnet/blazor-samples#348

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-iisIncludes: IIS, ANCM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions