Skip to content

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

Closed
@kuldeepcis-lab

Description

@kuldeepcis-lab

Describe the issue

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.

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" } } }

  1. Add an API controller to server project and add a couple of method to get data from database.
  2. Register HTTPClient at client side project to call the API.
  3. 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.

Expected behavior

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

Screenshots
Screenshot_15
Screenshot_16

Issue Details

Do not edit this section. It is required for issue processing.

Expected behavior

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions