1

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.

Luke Hutton
  • 10,612
  • 6
  • 33
  • 58
  • possible duplicate of [Deploying website: 500 - Internal server error](http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error) – CodeCaster Apr 09 '15 at 21:23

1 Answers1

1

Create a binding to localhost for your website and navigate to http://localhost within a web browser on your server.

Since the request is coming from localhost, IIS will show you the error details in the browser.

Not a great solution, but the fastest that I've found so far.

tier1
  • 6,303
  • 6
  • 44
  • 75