简体   繁体   中英

Why can't i see a detailed error message in this aspx page?

I have a aspx page and it displays custom error but i can't see a detailed error message. My web.config looks like this,

<?xml version="1.0"?>
    <configuration>
    <appSettings />
    <connectionStrings />
    <system.web>
        <compilation debug="true" />
        <authentication mode="Windows" />
        <customErrors mode="On" />
    </system.web>
</configuration>

To see the error you need customErrors off , like this:

<customErrors mode="Off"></customErrors>

From the docs , here are the options for the mode attribute:

  • On - Specifies that custom errors are enabled. If no defaultRedirect attribute is specified, users see a generic error. The custom errors are shown to the remote clients and to the local host.
  • Off - Specifies that custom errors are disabled. The detailed ASP.NET errors are shown to the remote clients and to the local host.
  • RemoteOnly - Specifies that custom errors are shown only to the remote clients, and that ASP.NET errors are shown to the local host. This is the default value.

Warning

Setting Off on a live-production site is very risky as some error messages might compromise sensitive data on your site (like code and paths maybe even passwords).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM