发生错误时IIS7中出现500.19错误 [英] 500.19 error in IIS7 when an error occurs

查看:3295
本文介绍了发生错误时IIS7中出现500.19错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置:Windows 7,IIS7。我正在开发一个通过本地IIS服务器查看的应用程序,而不是内置的调试Web服务器。所以我的应用网址是 http://localhost/foo/bar.aspx 。我的web.config中有 < customErrors> 部分,我没有更改IIS中的任何设置。

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, and I haven't changed any settings in IIS.

如果发生任何错误,我总会收到以下错误屏幕:

If any error occurs, I always get the following error screen:


HTTP错误500.19 - 内部服务器错误

<$ c $中不允许使用绝对物理路径 C:\inetpub \custerr c> web.config文件中的system.webServer / httpErrors 部分。改为使用相对路径。

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.

这是我的 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>

如何摆脱此配置错误,以便查看详细错误?

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

推荐答案

过去几天我一直在处理这个问题,并找到了解决方案。 Web.Config文件可能指定其中一个错误页面的绝对路径。这可能不是您正在测试的应用程序的Web.Config。对我来说,这是该网站的Web.Config文件。

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.


  1. 如果您发现有问题的Web.Config文件,您可以删除绝对路径和问题应该修复。

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

更简单的解决方案是改变你的 ApplicationHost.Config 文件设置 allowAbsolutePathsWhenDelegated 属性为 true

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">


这篇关于发生错误时IIS7中出现500.19错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆