display detailed error message on IIS 7.5

夙愿已清 提交于 2019-11-29 16:06:17
Zam

Perhaps other way to get detailed information (sorry, this is for IIS 8.5)

See sample of 500.asp page in me comment above

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!