How to Get More Detailed Errors from IIS
Written by Shai Ben-Naphtali Tuesday, 17 November 2009
On the new version of WebSitePanel, you can easily do this through the control panel! Click HERE to find out how!
Say you work on your website on whatever language that may be, for this example, I’ll use ASP.
Then you encounter an error message, for this example, say the dreaded 500 – Internal server error (picture 1).
So you sit there thinking “Ok, thanks! That doesn’t give me a clue on what my problem is!”
Lets fix that, shell we?
Edit your web.config file, inside the <system.webServer> section put this line in:
<httpErrors errorMode=”Detailed” />
See (picture 2) for an example.
IMPORTANT: If you are using ASP .NET, you also need to add the following inside the <system.web> tags of your web.config (at the end of the tag). If there is no <system.web>, simply create a starting and ending tag before <system.webserver> like so:<system.web> <customErrors defaultRedirect=”errors.aspx” mode=”Off” /> </system.web>
IMPORTANT: If you are using ASP, you may need to turn on errors being sent to the browser. This is done by adding the following tag right before the end system.web tag.
Now we that in place and saved, try to browse your website and in my case, this is what I now saw:
Ok! Now I know that I forgot my include file … how silly of me!
FYI, that code was bound to break on purpose, since I didn’t really have those includes… this code was just for the purpose of this demonstration and is noted for you, below:
<%@ Language=VBScript %>
<% Option Explicit %>
<!– #include virtual = “/adovbs.inc” –>
<!– #include virtual = “/conn.asp” –>
<!doctype html public “-//w3c//dtd html 3.2//en”>
<title>(Type a title for your page here)</title>
<body bgcolor=”#ffffff” text=”#000000″ link=”#0000ff” vlink=”#800080″ alink=”#ff0000″>
conn.ConnectionString = aConnectionString