I am running a Microsoft ASP.NET Web API 2.1 application in IIS7.5 and I am getting the generic:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
I have tried the following to get more detail on the actual error but so far, face palming:
- Set
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
- Added
<system.webserver> <httperrors existingresponse="PassThrough"/> </system.webserver>
- Checked windows event log for any unhandled exceptions, but none
Added an
ExceptionLogger
, but nothing appears in log file:public class Log4NetExceptionLogger : ExceptionLogger { private readonly ILog _log = LogManager.GetLogger(typeof(Log4NetExceptionLogger)); public override void Log(ExceptionLoggerContext context) { _log.Error("An unhandled exception occurred.", context.Exception); base.Log(context); } }
Added
<configuration> <system.webServer> <httpErrors errorMode="Detailed" /> <asp scriptErrorSentToBrowser="true"/> </system.webServer> <system.web> <customErrors mode="Off"/> <compilation debug="true"/> </system.web> </configuration>
- Browsed locally and get "This page can't be displayed" in IE, with a binding that was NOT localhost
I see the 500 responses in the IIS logs, just no detail to the error.