How to get detailed error when getting 500 error message

Programming, error messages and sample code > ASP.NET
When your website is not running properly in IE and got 500 error, you can follow these steps to show the detailed error message.

1. Open your IE-->TOOLS-->Internet option-->Advance-->uncheck"Show Friendly HTTP Error Message" and then submit.
After you unchecked it, if you still get this 500 error, you can follow the second step.

2. create a web.config file in your website root folder and put the script below in it, or you can put "<httpErrors errorMode="Detailed" />" between <system.webServer>and </system.webServer> in your existing web.config file.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
    </system.webServer>
</configuration>

3. Save the file, you can find the detailed error message of your site.