tags:

views:

854

answers:

1

Setup: windows 7, IIS7. I am working on an app that is being viewed through the local IIS server, not the built in debugging web server. (So my app url is http://localhost/foo/bar.aspx) There is NO <customErrors> section in my web.config.

When an error occurs, i see the following message: HTTP Error 500.19 - Internal Server Error Absolute physical path "C:\inetpub\custerr" is not allowed in system.webServer/httpErrors section in web.config file. Use relative path instead.

I havent changed any settings of IIS7, so i don't know why this is occurring. When i go to applicaitonhost.config, i see

<httpErrors errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
        <error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
        <error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
        <error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
        <error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
        <error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
        <error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
        <error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
        <error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
        <error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />
    </httpErrors>

How can I get rid of this configuration error so i can see detailed errors?

+2  A: 

I've been dealing with this issue for the last few days and found the solution. A Web.Config file is likely specifying an absolute path for one of the error pages. This may not be the Web.Config of the application you are testing. For me, it was the website's Web.Config file.

If you find the offending Web.Config file you can remove the absolute path and the problem should be fixed.

A much easier solution would be to alter your ApplicationHost.Config file to set the allowAbsolutePathsWhenDelegated property to true:

<httpErrors allowAbsolutePathsWhenDelegated="true" errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
firedfly
it is not possible to upvote you enough. i had a web.config in my web site root. deleted everythign from there. yayayayayayaya!!!!!!!!
Joel