Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS7 won't display ASP.Net error message or stack trace

I'm trying to debug an error in an ASP.Net 3.5 application. We recently moved the application from IIS6 to 7. In IIS6, code like this:

Throw new Exception("My message")

Would display a page giving the error message, nearby lines of code, and a stack trace (using "debug" compilation mode and no custom errors).

In IIS7, the "detailed" error message gives only the module and error code:

HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.

Detailed Error Information
Module  global.asax
Notification    BeginRequest
Handler StaticFile
Error Code  0x00000000
Requested URL   [My URL]
Physical Path   [My Path]
Logon Method    Not yet determined
Logon User  Not yet determined
Failed Request Tracing Log Directory    [My Directory]

I even set up Failed Request Tracing, which purports to give a stack trace but which still doesn't give me any line numbers or error messages, only the module name and HTTP status.

No. 111.
Severity    Warning 
Event   -MODULE_SET_RESPONSE_ERROR_STATUS 
  ModuleName    global.asax 
  Notification  1 
  HttpStatus    500 
  HttpReason    Internal Server Error 
  HttpSubStatus 0 
  ErrorCode 0 
  ConfigExceptionInfo
  Notification  BEGIN_REQUEST
  ErrorCode The operation completed successfully. (0x0)

How can I get the information I was getting in IIS6? I already know the error is in global.asax, I need a line number and a specific error message.

Also, I'm not sure if this is related but the site is precompiled and aspnet_compiler.exe apparently sets the web.config "debug" switch to false when it compiles (even with the "-d" option). My machine.config has no "deployment" tag. I just set "debug" back to true and recycle after compiling, which I assume would put the site back in debug mode, right?

like image 362
tloflin Avatar asked Nov 05 '22 16:11

tloflin


1 Answers

There is a setting in the error page config that tells IIS the level of detail information to show for local and remote requests. You might want to verify this is configured correctly. To access this setting launch the Internet Information Services Manager and go to

Site Home\Error Pages\Edit Feature Settings

Make sure you disable this setting in production

like image 170
Jose Garcilazo Avatar answered Nov 12 '22 17:11

Jose Garcilazo