can't get httpErrors to show yellow screen of death with details

1.1k Views Asked by At

I've looked at many posts about using httpErrors and I believe there's a deeper issue with my project, or at least my understanding.

We've recently moved from using customErrors to using HttpErrors instead. The Custom error would show fine, but in case of an error, I would only see the IIS blue screen (that has no information about the error).

Since then i've been trying to get a custom error page remotely and the YSOD locally, but with no success.

I've added "Response.TrySkipIisCustomErrors = true;" to Application_Error in Global.asax.cs but that didn't seem to make a difference. Also, the project uses both ASP .NET as well as MVC, not sure if that makes a difference.

I've been playing around with the existingResponse and errorMode and these are the results i've been seeing: (let my know if my formatting doesn't make sense)

[existingResponse | errorMode | remoteResult | localResult]

|    Replace       | detailedLocalOnly | Correct error page | IIS blue screen

|    Replace       |           Custom        | Correct error page | Correct error page

| PassThrough  | detailedLocalOnly |            YSOD          |    YSOD

|        Auto         |          Custom        |            YSOD          |    YSOD

|        Auto         | detailedLocalonly |            YSOD          |    YSOD

Here is my webconfig:

<httpErrors existingResponse="Auto" errorMode="Custom">
  <remove statusCode="404" subStatusCode="-1" />
  <error statusCode="404" subStatusCode="-1"  prefixLanguageFilePath="" path="404.html" responseMode="File" />
  <remove statusCode="500" subStatusCode="-1" />
  <error statusCode="500" subStatusCode="-1"  prefixLanguageFilePath="" path="500.html"  responseMode="File"/>
</httpErrors>  

Global.asax.cs

  protected void Application_Error(object sender, EventArgs e)
  {
      Response.TrySkipIisCustomErrors = true; 
      Exception ex = Server.GetLastError().GetBaseException();
      LogProvider.Log(LogProvider.LogLevels.Error, "Global Error", ex);
  }

Thanks for you help.

0

There are 0 best solutions below