Description
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:
- Go to repository and clone BlazorWebappOidc and Open the application in Visual Studio.
- 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" } } }
- Add an API controller to server project and add a couple of method to get data from database.
- Register HTTPClient at client side project to call the API.
- 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.