IIS Subweb Applications Are Virtual Directories

by Jon Davis 21. June 2009 14:32

Microsoft never ceases to amaze me how they keep showing the most obscure error messages and support documentation for the simplest of causes.

HTTP Error 500.19 - Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x80070005
Notification: BeginRequest
Module: IIS Web Core
Requested URL: http://www.mysite.com/myapp/
Physical Path: ~~
Logon User: Not yet determined
Logon Method: Not yet determined
Handler: Not yet determined
Config Error: Cannot read configuration file
Config File: ~~
Config Source:

   -1:

    0:
More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
 

I was getting IIS 7 error 500.19 on Windows Server 2008 over the weekend, and when I discovered it I spent hours on this error. Google didn't help; everyone pointed to invalid XML in the web.config or in applicationHost.config, or said that there must be an invalid DLL reference in applicationHost.config, or said that I need to add the proper users (IIS_IUSRs, Network Service, IUSR) to the directory and/or web.config. None of these solutions applied. There was nothing in my Windows event logs and enabling IIS tracing produced no log files.

It turned out to be a simple cause: the physical directory as configured in Basic Settings for the application was wrong. Why Microsoft did not include this rather obvious scenario in the Help file for this error is beyond me!!

In my case, my root web was working fine, but my subwebs were not working fine and I got this error for the subweb. The subweb was an individually configured ASP.NET application. I figured that this wasn't important because the root web was just a flat HTML file, but it mattered.

What happened in my case was that a few days ago I had relocated the root web, then updated IIS to point to the new directory. All of the subweb applications, however, were treated by IIS as virtual directories, each with its own physical directory mapping. So each had the stale path. More specifically, I moved "C:\dir\www.mysite.com" to "C:\dir\mysite.com", updated IIS for my site to point to \dir\mysite.com, and left it as such. The applications under ...\mysite.com were each pointing to the stale absolute path of C:\dir\www.mysite.com\[application] instead of picking up the relative path of their parent directory.

I had to update each subweb application's Basic Settings to point to the revised path, and the 500.19 error went away.

Hope this helps others like it would've helped me.

Jon


 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar