HTTP错误500.19 - 内部服务器错误 - system.webServer / httpErrors缺少部分声明

时间:2013-09-28 08:10:31

标签: asp.net-mvc asp.net-mvc-4 iis-7.5 asp.net-mvc-5

我有以下内容:

  <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

有人可以帮我解释一下。

我认为我不需要有自定义错误页面。但是,我读到的所有内容都告诉我,解决方案是添加自定义错误页面。

1 个答案:

答案 0 :(得分:0)

我必须从我的web项目中删除WindowsAzure.Diagnostics引用(也包含一个感叹号)并再次添加到2.7版本。之后问题没有发生