HTTP Error 500.19 in IIS 8 when system.web configuration is present in apphost config

10,371

Solution 1

In our case we didn't have URL Rewrite installed. Instead of complaining about it missing it just gave us this generic message.

I think what you need to do when transferring a site from IIS 7.x to 8.x is first verify all of the addons are properly installed.

Solution 2

I've seen this error occur when all of the necessary modules are not installed. Instead of telling you that a module is missing it will complain that the config is corrupt. Check that the same modules you've installed on the IIS 7/7.5 machines are also installed on IIS 8.

Solution 3

I had a similar issue which I posted to SO here. Also take a look at this post on Feature Delegation.

Solution 4

Hi I found this youtube video helpful IIS 7 Tutorial which could also help you on your problem. Or perhaps this links could help you.Troubleshooting HTTP 500.19 Errors in IIS 7, Error message when you visit a Web site that is hosted on IIS 7.0: "HTTP Error 500.19 – Internal Server Error". Troubleshoot IIS7 errors like a pro

The links that I provided will guide you to determine the cause of your problem which from your statement it changes in different instances. And below it is a solution.

Share:
10,371
Jamie Macia
Author by

Jamie Macia

Updated on July 25, 2022

Comments

  • Jamie Macia
    Jamie Macia almost 2 years

    We have a utility that automatically sets up ASP.NET web applications upon install on customer servers. This utility traditionally adds a number of configurations to the Location path for the new app in applicationHost.config. We do this programmatically using the Microsoft.Web.Administration configuration classes.

    This works fine in IIS 7.0 and IIS 7.5, but when we try to install the identical configuration in IIS 8 (Server 2012), we start getting 500.19 server errors for everything hosted on the server because of a supposedly malformed XML element (HRESULT 0x8007000d). I systematically went through all of the configuration we install, and it appears to be the the system.web/httpRuntime maxRequestLength attribute (see below). It appears that the system.web configuration element itself is the culprit, as the error does not disappear until it itself is removed.

    I've confirmed that the section definition for system.web/httpRuntime states that it is allowed Everywhere, and you can set system.web configuration at other levels of the configuration (e.g., web.config) without issue. Why can't we set it in applicationHost.config?

    <location path="Default Web Site/ManagementConsole">
        <!-- ... more config ... -->
        <system.web>
            <httpRuntime maxRequestLength="10240" />
        </system.web>
    </location>
    

    Edit: I noticed after the original post that the file the 500.19 error referenced was a temporary app pool config file (C:\inetpub\temp\apppools\apppoolname\apppoolname.config. The content of that file is:

    <!-- ERROR: There's been an error reading or processing the applicationhost.config file.  Line number: 905  Error message: The configuration section 'system.web' cannot be read because it is missing a section declaration
    -->
    

    But when I go into applicationHost.config and add a section group definition for system.web and a section definition for httpRuntime, the message in the 500.19 changes to claiming that there is a duplicate system.web/httpRuntime definition! So I can't define it, and I can't not define it. What??

  • Jamie Macia
    Jamie Macia over 11 years
    I went through and installed a few roles and features that were present on my working Server 2008 R2 machine, but that unfortunately didn't fix the problem.
  • Jamie Macia
    Jamie Macia about 11 years
    Commenting out the section isn't a sufficient solution without telling me why this is no longer valid (though "because Microsoft says so" is a valid reason if it's true--I haven't heard that, though). Feature delegation was already set to Read/Write for Request Filtering.
  • Jamie Macia
    Jamie Macia about 11 years
    Thanks, but as I said in the post: 1) This issue is with IIS 8, not 7, and in fact does not affect IIS 7 at all, similar as they may be, and 2) None of these links address the underlying error I noted in the edit of my post (long before your answer).
  • HowardvanRooijen
    HowardvanRooijen over 10 years
    That was the exact issue for me.
  • Pynt
    Pynt about 10 years
    This solved my issue as well. Using WebPI, searching for URL rewrite module, installed and fixed. In my case the 500.19 error report included an empty Config Error with Config Source: -1: 0: so no idea where the issue occurred.