Wednesday, February 2, 2011

Displaying Custom Error Messages / Enabling Detailed Errors on IIS 7

 

I was deploying an ASP.NET MVC 2 default application to one of my GoDaddy hosted sites when I encountered the below screen:

20110203-1524-Runtime Error

How can I know the underlying problem?

Simply edit the web.config file.

(1) Inside <system.webServer> node add

<httpErrors errorMode=”Detailed” />

<asp scriptErrorSentToBrowser=”true” />

(2) Inside <system.web> node add

<customErrors mode=”Off” />

<compilation debug=”true” />

 

Wasn’t that so easy?!

 

NOTE: Remove the said lines after you have found and applied the fix to your problem. You don’t want your regular website visitor know the internals of your application, right? Smile

No comments:

Post a Comment