I am trying to deploy an ASP.NET application. I have deployed the site to IIS, but when visiting it with the browser, it shows me this:
Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
After fiddling around with the web.config, I got:
The page cannot be displayed because an internal server error has occurred.
How can I see the actual issue behind this server error?
For IIS 8
Turn off IIS8 custom errors by Raul
If you are using IIS 8.5 it may be that you need to change the ApplicationPool ID setting from ApplicationPoolId to NetworkService
Right click the Application Pool in question, click on "Advanced Settings" and then scroll down to ID - it will probably be set to ApplicationPoolIdentity. Click the button (..) and select NetworkService from the dropdown list instead.
Also make sure that if it is a .NET 2.0 application that you are not referencing the 4.0 framework in your App Pool.
For me, the following code in the web.config was the culprit. When I removed it, the web site worked fine.
In my case, I put a mistake in my
web.config
file. The application key somehow was put under the <appSettings> tag. But I wonder why it doesn't display a configuration error. The error 500 is too generic for investigating the problem.In addition to the other suggestions, make sure to change the
existingResponse
attribute of thehttpErrors
node toAuto
fromReplace
, or to remove that property entirely.I was pulling my hair out over this issue. Making sure the following entry was in the root
web.config
file fixed it for me:Remember that you have to add this to the existing XML elements, if they're already there. You can't just add at the end of the file, because you can't have multiple copies of any element.