Lions Den

The Code and Times of Hanan Schwartzberg

About Hanan | Hanan's CV | Contact Hanan

April 18, 2010

IIS7.5 “HTTP Error 500.19 – Internal Server Error”

Filed under: IIS7 — Tags: , , , — Hanan Schwartzberg @ 10:33 pm


The symptom

After loading an ASP.NET web application on an IIS7.5 server, navigating to the site resulting in the following error:

HTTP Error 500.19 - Internal Server Error


The search for a cause and a solution

The first step was this Microsoft KB Article that breaks down the 500.19 error based on the HResult: http://support.microsoft.com/kb/942055. Unfortunately, for the HResult above, 0x8007000d, the only cause listed is “a malformed XML elemen” in the web.config. After spending some time looking at the web.config I came to the conclusion there were no malformed tags.

The next solution I found was from JohnnyW on ASP.NET, http://forums.asp.net/p/1497910/3536801.aspx#3536801. JohnnyW’s error was evidently caused by Ajax not being properly installed. He includes this link on how to configure AJAX for ASP.NET. Since, due to some old controls we do require the AJAX 1.0 extensions to be installed I made the changes to the web.config it recommends, but still kept getting the same error.

I decided to manually hunt for the cause in the web.config and so I started to remove sections one at a time until the error disapeared and the site loaded.


The actual cause and soluion

The section that was actually causing the error was the rewrite section.

<rewrite>
  <rules>
    <rule name="Redirect to www" stopProcessing="true">
      <match url=".*" />
      <conditions>
        <add input="{HTTP_HOST}" 
            pattern="^www.mySite.com$" />
        <add input="{HTTP_HOST}" 
            pattern="^mySite.com$" />
        <add input="{HTTP_HOST}" 
            pattern="^mySite.com$" />
      </conditions>
      <action type="Redirect" 
          url="http://www.my_Site.com/{R:0}"
          redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>

Searching for information on redirect rules led me to http://geekswithblogs.net/kit/archive/2009/04/19/131291.aspx, where he explains you can use URL Rewrite “by installing the URL Rewrite Module.” This was what actually caused the 500.19 error. The server didn’t have the url rewrite module installed. I solved the issue by downloading the IIS URL Rewrite 2.0 from here: http://www.iis.net/download/URLRewrite and installing it. Instantly the 500.19 error was cleared up.

Home | Site Design | Banner Design | Code Den | Offsite Posts | Downloads | Photography | About Hanan | Hanan's CV | Contact Hanan
Copyright © 2009 Hanan Schwartzberg. All rights reserved.