HTTP Error 500.19 - Internal Server Error - Error Code 0x80070490 - IIS 7.5 ( Works on Azure )

1.5k views Asked by At

I am executing my code in the Azure emulators. The code I have built is Thinktecture's IdentityServer2. After the emulators start running and everything is ready I get an error when I fire the URL in the browser. There is another SO thread about this issue. But the solutions don't seem to apply to my Web.Config

  1. There is no URL rewrite module rule
  2. Default website in IIS manager has pass-through authentication. What is this ?
  3. Gave full control to users to access wwwroot.
  4. virtual folder>basic settings> Connect As > Path credentials has pass-through authentication

What else should I do ?

Web.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<section name="thinktecture.identityServer.repositories" type="Thinktecture.IdentityServer.Configuration.RepositoryConfigurationSection, Thinktecture.IdentityServer.Core" />
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<!-- ............................................... -->
<!-- start of identity server relevant configuration -->
<thinktecture.identityServer.repositories configSource="configuration\repositories.config" />
<system.identityModel configSource="configuration\identity.config" />
<system.identityModel.services configSource="configuration\identityServices.config" />
<connectionStrings configSource="configuration\connectionStrings.config" />
<system.diagnostics configSource="configuration\tracing.config" />
<location path="account/certificatesignin">
  <system.webServer>
  <security>
    <access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
  </security>
</system.webServer>
</location>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<diagnostics>
  <messageLogging logMessagesAtTransportLevel="true" logEntireMessage="true" logMalformedMessages="true" />
</diagnostics>
</system.serviceModel>
<appSettings>
<add key="idsrv:CreateTestDataOnInitialization" value="true" />
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true">
  <remove name="RoleManager" />
  <add name="SessionAuthenticationModule"  type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</modules>
<handlers>
  <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
  <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <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>
 <system.web>
<customErrors mode="RemoteOnly" />
<globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto" />
<profile configSource="configuration\profile.config" />
<compilation debug="true" targetFramework="4.5" />
<authentication mode="Forms">
  <forms loginUrl="~/account/signin" />
</authentication>
<pages>
  <namespaces>
    <add namespace="System.Web.Helpers" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Optimization" />
    <add namespace="System.Web.Routing" />
    <add namespace="System.Web.WebPages" />
  </namespaces>
</pages>
<membership defaultProvider="DefaultMembershipProvider">
  <providers>
    <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="ProviderDB" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="DefaultRoleProvider">
  <providers>
    <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="ProviderDB" applicationName="/" />
  </providers>
</roleManager>
<sessionState mode="Off"></sessionState>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
  </dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="System.Data.SqlServerCe.4.0" />
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
  <remove invariant="System.Data.SqlServerCe.4.0" />
  <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
</configuration>

Error

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
Config File    \\?\C:\Users\User1\AppData\Local\dftmp\Resources\95c4e530-03a7-4e9f-b0c5-152a2cd71ccf\temp\temp\RoleTemp\applicationHost.config

Note

This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.

Fix attempt 1 Doesn't work.

     <httpErrors errorMode="Custom" existingResponse="Replace">
    <!--Remove inherited 500 error page setting -->
    <remove statusCode='404' subStatusCode='-1'/> 
    <!--Override the inherited 500 error page setting with the 'My500.html' as its path-->
    <error statusCode='404' subStatusCode='-1' prefixLanguageFilePath='' path='/home/index' responseMode='ExecuteURL'/> 
    </httpErrors>
0

There are 0 answers