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

8

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

asp.net
iis
iis-8
asked on Stack Overflow Jan 29, 2013 by Jamie Macia • edited Feb 16, 2013 by Jamie Macia

4 Answers

3

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.

answered on Stack Overflow Jan 29, 2013 by GrokSrc
3

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.

answered on Stack Overflow Jul 26, 2013 by NotMe
2

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

answered on Stack Overflow Feb 9, 2013 by Mr Smith • edited May 23, 2017 by Community
2

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.

answered on Stack Overflow Feb 11, 2013 by bot • edited Feb 11, 2013 by bot

User contributions licensed under CC BY-SA 3.0