[asp.net] Web Application Problems (web.config errors) HTTP 500.19 with IIS7.5 and ASP.NET v2

This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS 7.5 we get the following error...

Here's the error in full:

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              IIS Web Core
Notification        Unknown
Handler             Not yet determined
Error Code          0x8007000d
Config Error
Config File         \\?\E:\wwwroot\web.config
Requested URL       http://localhost:80/Default.aspx
Physical Path 
Logon Method        Not yet determined
Logon User          Not yet determined
Config Source
   -1: 
    0: 

The machine is running Windows Server 2008 R2. We're developing our Web Application using Visual Studio 2008.

According to Microsoft the code 8007000d means there's a syntax error in our web.config -- except the project builds and runs fine locally. Looking at the web.config in XML Notepad doesn't bring up any syntax errors, either. I'm assuming it must be some sort of poor configuration on my part...?

Does anyone know where I might find further information about the error? Nothing is showing in EventViewer, either :(

Not sure what else would be helpful to mention...

Assistance is greatly appreciated. Thanks!

UPDATES! - POSTED WEB.CONFIG BELOW

Ok, since I posted the original question above, I've tracked down the precise lines in the web.config that were causing the error.

Here are the lines (they appear between <System.webServer> tags)...

    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </httpHandlers>

Note: If I delete the lines between the <httpHandlers> I STILL get the error. I literally have to delete <httpHandlers> (and the lines inbetween) to stop getting the above error.

Once I've done this I get a new 500.19 error, however. Thankfully, this time IIS actually tells me which bit of the web.config is causing a problem...

    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </handlers>

Looking at these lines it's clear the problem has migrated further within the same <system.webServer> tag to the <handlers> tag.

The new error is also more explicit and specifically complains that it doesn't recognize the attribute "validate" (as seen on the third line above). Removing this attribute then makes it complain that the same line doesn't have the required "name" attribute. Adding this attribute then brings up ASP.NET error...

Could not load file or assembly 'System.web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56' or one of its dependencies. The system cannot find the file specified.

Obviously I think these new errors have just arisen from me deleting the <httpHandlers> tags in the first place -- they're obviously needed by the application -- so the question remains: Why would these tags kick up an error in IIS in the first place???

Do I need to install something to IIS to make it work with them?

Thanks again for any help.

WEB.CONFIG

Here's the troublesome bits of our web.Config... I hope this helps someone find our problem!

<system.Web>

<!-- stuff cut out -->

    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56" validate="false"/>
    </httpHandlers>
    <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </httpModules>
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
        <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </modules>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </handlers>
</system.webServer>

This question is related to asp.net iis web-applications web-config iis-7.5

The answer is


Comment the following lines in the web.config file.

<modules>
    <!--<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>-->
</modules>

<handlers>
    <remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
    <!--<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>-->
</handlers>

This will work.


I had the same issue in Windows 7.

The solution was to go to basic settings > connect as > specific user - and log in as a user, instead of the default 'pass-through'

This fixed the issue for me.


Same issue on Server 2016, IIS 10, 500.19 error. I installed the redirect module and it worked. I do not know why this was not included by default.

https://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads

To be clear it looks like the web.config from IIS 7 will work, or is designed to work, but the lack of this module gives the really odd and unhelpful error. Googling takes you to a Microsoft page which insists that your site is corrupted or your web.config is corrupted. Neither seems to be the case.

That unhelpful page is here: https://support.microsoft.com/en-us/kb/942055


The below config was the cause of my issue:

    <rewrite>
      <rules>
        <clear />
        <rule name="Redirect to HTTPS" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^.*spvitals\.com$" />
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>

Note: I removed this section for local testing, as it works fine in Azure.


I had these exact symptoms and my issue was similar to Peter's. Was setting up an existing project on a new server. My project referenced the IIS7 URL Rewriting module, but that hadn't been installed yet on the new server. Installing it fixed my issue.

You can use the Microsoft Web Platform Installer to install it. Execute it, select Products, in the left menu select Server and find URL Rewrite in the list and install it.

Or you can download it here.


Windows 7

Try this,

run cmd as Admin.

Unistall all iis.

start /w pkgmgr.exe /uu:IIS-WebServerRole;WAS-WindowsActivationService

Reinstall iis and normaly it's work

Alain


Another way of getting 500.19 errot for no apparent reason is - missing directories and/or broken permissions on them.

In case of this question, I believe the question asks about full IIS version. I assume this because of this line:

Config File         \\?\E:\wwwroot\web.config

IIS installer usually creates the wwwroot for you and that's the default root folder for all websites and mount point for virtual directories. It always exists, so no problem, you usually don't care much about that.

Since web.config files are hierarchical, you can put there a master web.config file and have some root settings there, and all sites will inherit it. IIS checks if that file exists and tries to load it.

However, first fun part:

This directory will exists if you have IIS properly installed. If it does not exist, you will get 500-class error. However, if you play with file/directory permissions, especially 'advanced' ones, you can actually accidentally deny IIS service account from scanning/reading the contents of this directory. If IIS is unable to check if that wwwroot\web.config exists, or if it exists and IIS is not able to open&read it - bam - 500-class error.

However, for full IIS it is very unlikely. Developers/Admins working with full IIS are usually reluctant regarding playing with wwwroot so it usually stays properly configured.

However, on IIS Express..

Usually, IIS Express "just works". Often, developers using IIS Express often are not aware how much internally it resembles the real IIS.

You can easily stumble upon the fact that IIS Express has its own applicationHost.config file and VS creates and manages it for you (correctly, to some extent) and that sort of an eye-opener telling you that it's not that simple and point-and-click as it seems at first.

Aside from that config file, VisualStudio also creates an empty directory structure under your Documents folder. If I remember correctly, IIS Express considers these folders to be the root directories of your website(s) upon which virtual directories with your code are mounted.

Later, just like IIS, when IIS Express starts up, it expects these folders to exist and checks for root web.config files there. The site web.config files. Almost always, these web.config files are missing - and that's OK because you don't want them - you have your **application web.config", they are placed with rest of the content in a virtual directories.

Now, the second fun part is: IIS Express expects that empty directories. They can be empty, but they need to exist. If they don't exist - you will get a 500-class error telling you that "web.config" file at that path cannot be accessed.

The first time I bumped into this problem was when I was clearing my hard drive. I found that 'documents\websites' folder, full of trash, I recognized several year-old projects I no longer work on, all empty, not a single file, so I deleted it all. A week later - bam - I cannot run/debug any of the sites I was working at the moment. Error was 500.19, cannot read config file.

So, if you use IIS Express and see 500-class error telling about reading configuration, carefully check the error message and read all paths mentioned. If you see anything like:

c:\users\user\documents\visual studio 2013\projects\WebProject1\WebProject1.web\web.config
c:\users\zeshan.munir\documents\visual studio 2015\projects\WebProject1\WebProject1.web\web.config
c:\users\zeshan.munir\documents\visual studio 2017\projects\WebProject1\WebProject1.web\web.config
etc..

Go there exactly where the error indicates, ensure that these folders exist, ensure that IIS worker account can traverse and read them, and if you notice that anything's wrong, maybe it will be that.

BTW. In VisualStudio, on ProjectProperties/Web there's a button "Create Virtual Directory". It essentially does this very thing, so you may try it first, but IIRC it can also somethimes clear/overwrite/swap configuration sections in applicationHost.config file, so be careful with that button if you have any custom setups there.


I had the same error. I had an IIS site with .net framework version 2.0, but my app needed 4.0. I changed the version and it worked.

Posting just as a reminder if someone might have the same issue.


In my case, there was something wrong with the .NET Core Windows Hosting Bundle installation.

I had that installed and had restarted IIS using ("net stop was /y" and "net start w3svc") after installation, but I would get that 500.19 error with Error Code 0x8007000d and Config Source -1: 0:.

I managed to resolve the issue by repairing the .NET Core Windows Hosting Bundle installation and restarting IIS using the commands I mentioned above.

Hope this helps someone!


This error is related to web.config file. When web.config is not proper or using some features which is not available in IIS, then this issue will come. In my case, I forgot to install URLRewrite module and was referencing it in web.config. It took some time to find the root cause. I started removing sections one by one and checked, only then i was able to find out the actual issue.


Make sure all of your IIS features are properly enabled.

  • Open Windows Features (Turn Windows features on or off).
  • Scroll down to Internet Information Services

  • Open the World Wide Web plus box drop down

  • Open the Application Development Features plus box drop down
  • Manually check all of the subsequent check boxes, then click ok

enter image description here


I just add an answear because I spent hours trying to solve the same symptoms (but different issue):

A possible cause is a x86 dll in a 64 bits app pool, the solution is to enable 32 bits apps in the application pool settings.


I got this error by putting the <customErrors> tag inside of <system.webServer> instead of <system.web> where it belongs. There was a little squiggle under the <customErrors> tag but I didn't notice it right away.


This lovely detailed error is still present in 2019! I just want to add that if your web.config is valid and accessible it most likely is a dependency issue.

As mentioned by the OP it was a AJAX module, and as by others commonly the Rewrite module. Just keep your eyes open in your web.config what modules and libraries your tags are referencing to since the error code 0x8007000d can be about ANY dependency.

In my case I didn't realize the AspNetCore bundle was missing and had to be installed! So happy I found this post!!


I had exact same error message with IIS10 and Windows 10. I tried everything listed here (and other internet pages as well) but it did not fixed it. What solved the issue was to install .NET Core Hosting a second time (I choose "Repair" button).

I'm 100% confident this is what fixed it because I had to deploy the same website to other laptops as well (different brands but all Windows 10). The same error message (500.19) occurred and reinstalling bundle fixed it again.


After battling with this for a day on a new machine I came across the following links. I was missing the rewrite modules. This fixed everything.

http://forums.iis.net/t/1176834.aspx

http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/


If you are deploying asp.net.core application you also must install .net core hosting bundle. https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-3.0#install-the-net-core-hosting-bundle


Had the same problem as above, same error code etc. Setting up a local website on Windows 8. After much searching it was found that we were missing URL rewrite. After downloading it everything was fine. :)


For me, re-registering asp.net for iis did the trick. Hopefully that helps someone else.

aspnet_regiis.exe -i

To sum up based on answers here and elsewhere:

  1. Check the .NET version of the app pool (e.g. 2.0 vs 4.0)
  2. Check that all IIS referenced modules are installed. In this case it was the AJAX extensions (probably not the case these days), but URL Rewrite is a common one.

My IIS 7.5 does not understand tag in web.config In VS 2010 it is underline that tag also. Check your config file accurate to find all underlined tags. I put it in the comment and error goes away.


This may or not be related....I started off with the same error mentioned above, started googling, making changes, getting new errors, endless loop.

The change that got me by that error was messing with the Feature Delegation in IIS Manager under the Management section of the server. I'm sorry I can't remember which one I changed, but googling might help.

That got me past the 1st error into a whole new stream of others, some totally nonsensical. (I would get one error when running under a virtual directory, converting it to an application yielded another error, etec etc). What finally solved this series of errors was: IIS manager, Application Pools, DefaultAppPool, Enable 32-Bit applications=True

I had started this app on a 32 bit windows xp box, and I am now running it on a 64Bit Windows 7 box.

So hopefully this helps someone else.


Similar to the top answer, we were getting this incredibly unhelpful exception because of a missing IIS CORS module. It was the exact same error with Error Code (0x8007000d) and Config Source (-1: 0:), but installing the URL Rewriting module didn't fix it.

We had recently updated the web.config to enable CORS for some developers that needed it, but did not expect it would be required for all developers to install the IIS CORS module. Unfortunately it looks like it is required.

To fix it, install the IIS CORS module from here.


Examples related to asp.net

RegisterStartupScript from code behind not working when Update Panel is used You must add a reference to assembly 'netstandard, Version=2.0.0.0 No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization How to use log4net in Asp.net core 2.0 Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state How to create roles in ASP.NET Core and assign them to users? How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause() ASP.NET Core Web API Authentication Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0 WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery

Examples related to iis

ASP.NET Core 1.0 on IIS error 502.5 CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default Publish to IIS, setting Environment Variable IIS Manager in Windows 10 The page cannot be displayed because an internal server error has occurred on server The service cannot accept control messages at this time NuGet: 'X' already has a dependency defined for 'Y' Changing project port number in Visual Studio 2013 System.Data.SqlClient.SqlException: Login failed for user "This operation requires IIS integrated pipeline mode."

Examples related to web-applications

Spring - No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call How do I choose the URL for my Spring Boot webapp? Difference between MEAN.js and MEAN.io External VS2013 build error "error MSB4019: The imported project <path> was not found" How to unpackage and repackage a WAR file IntelliJ, can't start simple web application: Unable to ping server at localhost:1099 Using form input to access camera and immediately upload photos using web app Pass user defined environment variable to tomcat ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d Best practices when running Node.js with port 80 (Ubuntu / Linode)

Examples related to web-config

No assembly found containing an OwinStartupAttribute Error IIS Config Error - This configuration section cannot be used at this path How to enable GZIP compression in IIS 7.5 how to set start page in webconfig file in asp.net c# Authentication issue when debugging in VS2013 - iis express Forms authentication timeout vs sessionState timeout Specified argument was out of the range of valid values. Parameter name: site Access-control-allow-origin with multiple domains "An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page..." ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d

Examples related to iis-7.5

The client and server cannot communicate, because they do not possess a common algorithm - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32Exception Register .NET Framework 4.5 in IIS 7.5 HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers IIS error, Unable to start debugging on the webserver How do I get to IIS Manager? How prevent CPU usage 100% because of worker process in iis How do I give ASP.NET permission to write to a folder in Windows 7? ASP.NET 4.5 has not been registered on the Web server Fixing slow initial load for IIS "Cannot verify access to path (C:\inetpub\wwwroot)", when adding a virtual directory