How do I enable .NET to show more detailed error messages on IIS 7.0?

How do I enable .NET to show more detailed error messages on IIS 7.0?

By default, our Windows hosting servers
display a generic error when any .NET application generates an
exception. We display a generic error because the detailed error
messages allow a malicious user to obtain sensitive information.


To troubleshoot the error, you can modify your web.config file
and specify that a custom error message displays. A custom error
message helps you to locate the specific code that is causing the
issue.


CAUTION: The code samples we provide below do not constitute a
complete web.config file. Do not replace your existing web.config file
with the code we provide. Before changing your web.config file, we
recommend creating a backup.



Use the sample code below to display custom error messages on IIS 7.0:

<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
</configuration>
    • Related Articles

    • How do I enable .NET to show more detailed error messages on IIS 6.0?

      By default, our Windows hosting servers display a generic error when any .NET application generates an exception. We display a generic error because the detailed error messages allow a malicious user to obtain sensitive information. To troubleshoot ...
    • IIS Detailed errors

      If you want to enable this detailed error message to be shown on the clients as well, then you need to change the setting in the IIS7 manager. Follow the below steps for the same: 1. Open the IIS7 manager 2. Select the Website and on its features ...
    • How do I enable detailed errors in classic ASP?

      You can enable detailed error messages for your classic ASP site defaulted to Windows/IIS by using a web.config file with the following: <configuration> <system.webServer> <httpErrors errorMode="Detailed" /> </system.webServer> </configuration> Note: ...
    • How do I enable detailed errors in classic ASP?

      You can enable detailed error messages for your classic ASP site defaulted to Windows/IIS by using a web.config file with the following: <configuration> <system.webServer> <httpErrors errorMode="Detailed" /> </system.webServer> </configuration> Note: ...
    • Intro to IIS binding

      Intro to IIS bindings --------------------------- Microsoft’s Internet Information Services (IIS) has been built around a very flexible “binding” system.  When working with a website a “binding” is the combination of protocol (http, ftp, https, ...