How to enable error in IIS Server?
How to enable error in IIS Server for debugging the issue in code?
1) Enable IIS detailed errors
IIS introduces a new custom errors feature, which by default hides the error responses issued by the server to remote clients, replacing them with a basic error message. This is critical for security of your site, as errors frequently contain sensitive information that you don’t want others to see, but makes getting to the bottom of the problem harder since you cannot see those very error details. So, if you are requesting your site from another machine, you may still get a basic error that looks like this:
You have two options here:
Step 1) Make the request locally from the server machine.
By default, you will get the detailed error.
Step 2) Enable detailed errors for remote clients.
First, if your error is an ASP.NET exception (you can tell if it says “Runtime Error” and has the framework version), please be aware that ASP.NET overrides the IIS custom error mechanism with its own implementation of custom errors, so you should turn the ASP.NET custom errors off to see detailed ASP.NET exceptions. You DO NOT have to configure IIS custom errors for ASP.NET exceptions (it would be silly to have to do it in two places). To turn off ASP.NET custom errors, place the following in your web.config:
<system.web>
<customErrors mode=”Off” />
</system.web>
If the error is not an ASP.NET error, turning off IIS7 custom errors will allow error responses from your application to be sent to remote clients without being censored by the IIS7’s custom errors module.
Step 3)
You can do this from the IIS Admin tool by running
“Start>Run>inetmgr.exe”,
Step 4) Selecting your website/application/virtual directory in the left-hand tree view,
clicking on the “Error Pages” icon, clicking right side link “Edit Feature Settings” action,
Please select detail error and press ok.
Step 5)
Please select application name and click on “ASP Icon”
Expand “Debugging Properties” and Click Send error to browser “true”
And click right side apply button.