Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
582 views
in Technique[技术] by (71.8m points)

asp classic - display detailed error message on IIS 7.5

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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...