How to remove error messages - IIS7
You can also go into IIS manager --> Error Pages then click on the right on "Edit feature settings..." And set the option to "Detailed errors" then it will be your application that process the error and not IIS.
To prevent IIS7 hijacking your error pages, set existingResponse="PassThrough"
in your httpErrors
section in your web.config
file. For example:
<configuration>
<system.webServer>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
</configuration>