500 Internal Server Error - Asp.Net Core App deployed on IIS

Sometime Asp.Net Core Application gives error after deploying on IIS. One of the errors is Internal Server Error. On the development, machine application works just fine but after deploying, this error messages appeared.

Example error message : 

500 Internal Server Error An error occurred while starting the application.


Here is some possible solution to fix this error : 

1) Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". You will see the error file & findout the exact issue.

2) Check that you set up the right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like a connection string. On your machine, by default, you have "Development" environment.

3) You may use Error Handling middlewares for showing exceptions like

> app.UseDeveloperExceptionPage();


If you still have issue try to Install the latest .NET Core Hosting Bundle on the IIS server. The bundle installs the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module allows ASP.NET Core apps to run behind IIS.

Publishing ASP.NET Core Applications for IIS 

https://www.binkod.in/2020/08/deploy-aspnet-core-application-to-iis.html

Post a Comment

If you have any questions or concerns, please let me know.

Previous Post Next Post