8

I have the following:

  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="Off"/>   </system.web>

and also:

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

When I run my application I am getting an error page saying:

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

Can someone help explain this for me.

I thought with the that I didn't need to have a custom error page. However everything I read tells me that the solution is to add a custom error page.

  • May be this answer will help: http://stackoverflow.com/questions/2054582/iis-7-0-error-500-19-internal-server-error – Andrey Gubal Sep 28 '13 at 16:05
  • On what pool your application is deployed? Try to manipulate then it might help you out! – Imran Sep 28 '13 at 16:34

2 Answers2

9

In hope that the following answer will help someone later on, I will share my experience with this issue.

This error can appear due to various reasons. Lately, I have experienced the error due to the following reasons:

  • Missing URL Rewrite Module.

My Web.config file contains a <rewrite></rewrite> section which requires the IIS URL Rewrite Module to be installed (can be done using the Web Platform Installer).

  • Upgrade of Azure SDK.

My Web.config file contained the following entry:

<system.diagnostics>
  <sharedListeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,
               Microsoft.WindowsAzure.Diagnostics,
               Version=2.3.0.0,
               Culture=...
               PublicKeyToken=...">

After upgrade of Azure SDK (2.3.x -> 2.6.x), this "hard" dependency on version 2.3.x could not be resolved. To resolve this, I removed the Version element entirely (including Culture and PublicKeyToken), since a dependency on the most recent assembly version is fine in my case.

Lasse Christiansen
  • 10,205
  • 7
  • 50
  • 79
  • Same but different. My references were pointing to 2.1.0.0 where my web.config had been updated to 2.4.0.0. Simply updated the references (after about 4 hours of trying other things after an IIS re-install). – nealkernohan Jul 01 '15 at 17:03
  • Referencing two different version of Microsoft.WindowsAzure.ServiceRuntime dll caused this issue and broke my service. Runtime configuration to redirect the version did not help. Had to remove older version of dependency from various solutions and rebuilt the whole stack to fix it. – Gopinath Aug 02 '15 at 20:52
  • I had Version=2.7.0.0 and removing it solved the problem – Gökhan Kurt Apr 13 '16 at 11:04
  • This answer isn't pertinent to the question. – Spencer Sullivan Jun 29 '17 at 13:30
0

I had to remove the WindowsAzure.Diagnostics reference from my web project (also contained an exclamation mark) and add it again to the 2.7 version. After that the problem did not occure

Gertjan
  • 519
  • 4
  • 5