安裝程序:Windows 7,IIS7。我正在研究通過本地IIS服務器查看的應用程序,而不是內置的調試Web服務器。所以我的應用程序的網址是http://localhost/foo/bar.aspx
。在我的web.config中有沒有<customErrors>
部分,並且我沒有更改IIS中的任何設置。當發生錯誤時,IIS.19中的500.19錯誤
如果出現任何錯誤,我總是得到如下錯誤屏幕:
HTTP錯誤500.19 - 內部服務器錯誤
絕對物理路徑「C:\inetpub\custerr
」是不允許在web.config中system.webServer/httpErrors
節文件。改用相對路徑。
這裏是我的applicationhost.config
內容:
<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>
我怎樣才能擺脫這種配置錯誤的,所以我可以看到詳細的錯誤?
這是不可能upvote你足夠。我在我的網站根目錄中有一個web.config。從那裏刪除everythign。 yayayayayayaya !!!!!!!! – Joel 2010-04-08 14:40:27
http://stackoverflow.com/questions/4358339/how-to-prevent-iis7-for-handling-http-status-code-401 – Jared314 2011-01-18 19:43:58
我有iis7.5和vs2013,這個屬性是不允許在配置文件,在嘗試推進之後,錯誤仍然出現。 – DanielV 2015-09-15 06:56:36