2
votes

I'm trying to display detailed error message on a page using web.config on my remote server on hostgator running IIS 7.5. I've tried almost everything but can't get it to work.

<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed" existingResponse="PassThrough" />
  </system.webServer>
</configuration>

When i preview the page i get this error.

An error occurred on the server when processing the URL. Please contact the 
system administrator.

If you are the system administrator please click here to find out more about 
this error.
1
Do you have Remote Desktop access? if you have then you can follow the steps in this link, otherwise you might have to ask your hosting tech support to do it for you - chestysoft.com/asp-error-messages.aspJohn
Try making OFF Show Friendly Messages setting of browser.BabyDuck
The point is @John the OP wants to do it via the web.config.user692942
@MrZapzup That is not the issue as that message described by the OP is coming from IIS and is the default message when Send Errors to Browser is set to False in the ASP section of IIS.user692942
@John The <asp> section of the web.config is specifically for the configuration of Classic ASP applications. ASP is unmanaged so it wouldn't make sense that this was only available if the IIS App Pool was set to Managed. The beauty of web.config is you can override configuration without needing to access to the server or even access to files like applicationHost.config. Leads itself perfectly to budget hosting environments.user692942

1 Answers

1
votes

What you have is correct but you also need to tell the Classic ASP handler to send errors to the browser or the default

An error occurred on the server when processing the URL. Please contact the 
system administrator.

If you are the system administrator please click here to find out more about 
this error.

will be sent.

To do this you just need to override the current ASP configuration by updating the web.config file, something like;

<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed" existingResponse="PassThrough" />
    <asp scriptErrorSentToBrowser="True" />
  </system.webServer>
</configuration>

Because of the cool way IIS Configuration inheritance works this should override the default value of False in applicationHosts.config with the value defined in the site specific web.config file.

It's worth noting that in some budget / shared hosting environments where you have no access to server configuration you may have problems setting certain configuration values, because the owner (Hosting Company etc) has configured the applicationHosts.config section with a value of overrideModeDefault="Deny" locking a section from having configuration values overridden at the web application level.


Useful Links