Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net core app deployed on iis meets 500 internal server error

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

This message came out when I added database functionality to my asp.net core app and deployed it to iis. When I developed it in Visual Studio, everything went well. But after deploying, this error messages appeared.

I tried to use dotnet myapp.dll to run my app in the deploy folder, and found out it worked well. It is likely that the problem is relation to iis. I tried to add <compilation debug="true">..</compilation> to web.config, but it seems useless. What is problem are actually, or is there any other way to see the detailed error info to help find out what's happened?

like image 727
yitian Avatar asked Sep 30 '16 07:09

yitian


People also ask

How do I fix 500 internal server error IIS?

IIS error The error 500.19 is an internal server error often occurring on a server using Microsoft IIS software. It indicates that the configuration data for the page is invalid. To solve the issue, delete the malformed XML element from the Web. config file or from the ApplicationHost.

Why do I keep getting 500 internal server error?

The 500 Internal Server error could be caused by an error during the execution of any policy within Edge or by an error on the target/backend server. The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request.


1 Answers

  1. Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.

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

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

    app.UseDeveloperExceptionPage(); 
like image 193
Set Avatar answered Sep 20 '22 11:09

Set