Tools & Code: ASP.NET Debugging Tip


One of the most difficult things to do is watch your ASP.NET application display a run-time error once it has been deployed on a server.  If you haven’t configured your “web.config” file properly you will probably just see the dreaded “Server Error” header with nothing much more to help resolve the issue.

Buried in the huge amounts of information available for .NET, one item has often gone unnoticed that can help generate more substantive messages for problem resolution; even if they show up where they aren’t supposed to.  A simple adjustment to the “web.config” file as shown below should make remote-server debugging a less painful experience.

Steve Naidamast
Black Falcon Software, Inc.


<!–  CUSTOM ERROR MESSAGES
          Set customErrors mode=”On” or “RemoteOnly” to enable custom error messages, “Off” to disable.
          Add <error> tags for each of the errors you want to handle.
         “On” Always display custom (friendly) messages.
          “Off” Always display detailed ASP.NET error information.
          “RemoteOnly” Display custom (friendly) messages only to users not running
           on the local Web server. This setting is recommended for security purposes, so
           that you do not display application detail information to remote clients.
    –>
    <customErrors  mode=”Off”  />


About this entry