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

270,580

Solution 1

Aha! I beat this problem! My god, it was a beast for someone like me with limited IIS experience. I really thought I was going to be spending all weekend fixing it.

Here's the solution for anyone else who ever comes this evil problem.

First thing to be aware of: If you're hoping this is your solution, make sure that you have the same Error Code (0x8007000d) and Config Source (-1: 0:). If not, this isn't your solution.

Next thing to be aware of: AJAX is not properly installed in your web.config!

Fix that by following this guide:
http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx

Then, install the AJAX 1.0 extensions on your production server, from this link:

http://www.asp.net/ajax/downloads/archive/
Update: Microsoft seems to have removed the above page :(

That's it!

Solution 2

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.

Solution 3

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/

Solution 4

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

Solution 5

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. :)

Share:
270,580

Related videos on Youtube

Chuck Le Butt
Author by

Chuck Le Butt

Hello.

Updated on October 21, 2020

Comments

  • Chuck Le Butt
    Chuck Le Butt over 3 years

    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>
    
    • Alex Bagnolini
      Alex Bagnolini over 14 years
      Remove all the comments in the web.config. They begin with <!-- and end with -->.
    • Chuck Le Butt
      Chuck Le Butt over 14 years
      woot. it's something to do with <httpHandlers>
    • Jeremy McGee
      Jeremy McGee over 14 years
      Is this running in Integrated mode? If so, try Classic mode.
    • Chuck Le Butt
      Chuck Le Butt over 14 years
      @Alex - I removed all the comments, it didn't help. Thanks for the suggestion, though.
    • Chuck Le Butt
      Chuck Le Butt over 14 years
      @Joe I don't think I'm going to post the whole web.config. Probably wouldn't be wise... :-/
    • Chuck Le Butt
      Chuck Le Butt over 14 years
      @Jeremy Yes, I've tried that and, annoyingly, it isn't making any difference. I would have hoped this would have fixed it from what I've read so far.
    • Skurmedel
      Skurmedel almost 14 years
      I didn't have the same "end problem", but the part about removing the handlers from WebServer-section, thank youuuu! I removed the whole section and away went the error.
    • Jason
      Jason about 13 years
      Just replaced the httphandlers and httpmodules sections in my web.config and everything works fine. Thanks!
    • rainabba
      rainabba over 10 years
      Your suggestion led me to start randomly deleting sections of web.config until the error changed and that helped me home in on the fact that URL ReWrite wasn't installed correctly (had to reinstall) so the <rewrite> section was causing the 500.19.
    • Ty H.
      Ty H. over 8 years
      FYI, I had this error too... and it was just because .Net Framework wasn't installed on the server.
  • notanumber
    notanumber over 14 years
    thanks! The AJAX Extensions was the problem. I commented that section out since AJAX is now built into 3.5
  • Rob Sobers
    Rob Sobers over 13 years
    Looks like Microsoft broke that first link to configure ASP.NET AJAX.
  • Chuck Le Butt
    Chuck Le Butt over 13 years
    Found a mirror of the old content. So annoying the way MS documentation disappears so frequently.
  • jk.
    jk. over 13 years
    > 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. Thanks, DJjeffJ. Fixed it for me. URL rewirte module on dev server not installed.
  • WildJoe
    WildJoe over 13 years
    Yup... me too, I had .net 3.5 so ajax was already included, but rewriting isn't.
  • Marnix van Valen
    Marnix van Valen about 13 years
    +1 That fixed my problem too :) And it is a lousy error message indeed. If only a decent bit of error logging had been done, but there's nothing in the event log.
  • Uwe Keim
    Uwe Keim about 12 years
  • Pete
    Pete over 11 years
    +1. The web.config I grabbed from TFS had <rewrite> tags but I didn't have urlrewrite installed. I commented out the <rewrite> stuff and my site compiled and loaded up right away.
  • dvdmn
    dvdmn almost 11 years
    it took an hour to remember I used rewrite in the site. I wish microsoft had a better compiler error messages system. I would solve the issue in minutes if I would see the exact line of the web.config.
  • PhillyNJ
    PhillyNJ over 10 years
    Man you saved me a lot of time... Nice!!
  • rainabba
    rainabba over 10 years
    Using the suggestion from above, I deleted sections until i realized that my rewrite section was the cause and that led me to discover that I needed to reinstall urlrewrite.
  • rainabba
    rainabba over 10 years
    Your answer suggests that this error is ONLY for Ajax but it applies to urlrewrite also which means the error likely just refers to any suggestion which is dependant on a module that's not available.
  • Rexxo
    Rexxo about 10 years
    +1! Solved one of my issues, now have more to fix but I'm getting closer! Cheers!
  • ProNotion
    ProNotion over 9 years
    4 years on and this is still a problem. There is absolutely nothing in the error to provide any lead on the source of the problem. I too was moving an existing solution to a new server that did not yet have the module on and it was only by chance I stumbled across this answer so thanks a bunch as I was tearing my hair out!
  • Mukesh
    Mukesh over 9 years
    I faced same issue when I deployed a asp.net application to the new server,it was also php code in the application.Installing the URL Rewriting module fixed the issue.
  • Dima
    Dima almost 9 years
    How do you install Url Rewrite in Visual Studio for IIS Express?
  • Pacerier
    Pacerier over 8 years
    @Chuck, What does "I feel like Rocky" mean?
  • Nicolas Cadilhac
    Nicolas Cadilhac about 8 years
    You saved me a complete reinstall of the system and apps (a few days). Thanks!!
  • Frank Tzanabetis
    Frank Tzanabetis about 8 years
    @Pacerier A reference to Rocky Balboa, I'm assuming.
  • aron.lakatos
    aron.lakatos over 7 years
    This answer is valid for the 500.19 error during setting up Umbraco CMS as well.
  • Rob
    Rob over 7 years
    The problem continues with Server 2016, there is no feature/module to install that says "URL Rewrite". You must use the to install it, and after that my site worked (or at least stopped giving that issue).
  • Håkon Seljåsen
    Håkon Seljåsen almost 7 years
    To find dead links, I strongly recommend Archive.org. First link from 24th of Nov 2009: web.archive.org/web/20091124181427/http://www.asp.net/AJAX/…
  • Ken Keenan
    Ken Keenan over 6 years
    Similar, this error message is completely unhelpful!
  • Hugo Nava Kopp
    Hugo Nava Kopp over 5 years
    8 years on and this is still a problem. Thanks for this great answer @JJMpls
  • riverswb
    riverswb over 5 years
    This worked for me as well, here is a MSDN blog about installing .NET Core Windows Server Hosting bundle: blogs.msdn.microsoft.com/rohithrajan/2018/03/13/… Here is a link directly to the download: aka.ms/dotnetcore-2-windowshosting
  • Toby Artisan
    Toby Artisan over 4 years
    You can keep the rewrite rules in IIS if you install the IIS URL Rewrite module. It's at iis.net/downloads/microsoft/url-rewrite
  • Zero
    Zero about 4 years
    I am running into this issue, but URL Rewrite installation is not resolving...
  • Andrew Morton
    Andrew Morton almost 4 years
    I had just reinstalled Windows 10 with the in-place upgrade method, and either I had unticked some of those boxes or the reinstallation unticked them. The associated error code 0x80070021 appeared on the 500.19 page.
  • Tim Wilson
    Tim Wilson about 3 years
    This was a huge help, thank you! I was about to start hacking up my web.config as well. This saved a lot of time.
  • MoKG
    MoKG over 2 years
    I had the same issue. Reinstalling the .NET Core Hosting Bundle did the trick.