我有以下内容:
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<customErrors mode="Off"/> </system.web>
还有:
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<remove name="OPTIONSVerbHandler"/>
<remove name="TRACEVerbHandler"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
</system.webServer>
当我运行我的应用程序时,我收到一个错误页面:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module CustomErrorModule
Notification SendResponse
Handler Not yet determined
Error Code 0x80070490
Config Error The configuration section 'system.webServer/httpErrors' cannot be read because it is missing a section declaration
有人可以帮我解释一下吗?
我认为我不需要自定义错误页面。然而,我读到的所有内容都告诉我,解决方案是添加自定义错误页面。
最佳答案
希望以下答案对以后的人有所帮助,我将分享我对此问题的经验。
出现此错误的原因有多种。最近,由于以下原因,我遇到了错误:
- 缺少 URL 重写模块。
我的 Web.config 文件包含 <rewrite></rewrite>
需要安装 IIS URL 重写模块的部分(可以使用 Web 平台安装程序完成)。
- 升级 Azure SDK。
我的 Web.config 文件包含以下条目:
<system.diagnostics>
<sharedListeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,
Microsoft.WindowsAzure.Diagnostics,
Version=2.3.0.0,
Culture=...
PublicKeyToken=...">
升级 Azure SDK(2.3.x -> 2.6.x)后,无法解决对版本 2.3.x 的这种“硬”依赖关系。为了解决这个问题,我删除了 Version
完全元素(包括 Culture
和 PublicKeyToken
),因为在我的情况下,对最新程序集版本的依赖关系很好。
关于asp.net-mvc - HTTP 错误 500.19 - 内部服务器错误 - system.webServer/httpErrors 缺少部分声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19064840/