C# – IIS6 Running a ASP.NET Virtual Dir under a classic ASP Website

asp-classicasp.netciis-6

I want to create an ASP.NET virtual dir below a classic ASP WebSite.

The structure looks like the following.

IIS

Web Sites

Classic ASP Website

ASP.NET 2.0 Website (Virtual Dir) // This site sits under the classic ASP Website as a VD

For some reason when I try to access the Virtual Dir it looks for the Web Config in the Classic ASP Website. The two sites sit in seperate folders. We are attempting to strangle the Classic ASP website. There is one way into the website and therefore we want to use default port 80.

The following error is generated.

Parser Error Message: An error occured loading a configuration file: Failed to start monitoring changes to "This is the Classic ASP Website, when it should be the Virutal Dir" because access is denied.

Source Error
[No relevant source line].

Best Answer

Make sure that the ASP.NET worker process account (ASPNET on IIS5, IIS_WPG local group on IIS6 and higher) also has read access to the parent classic ASP site. The ASP.NET runtime looks in parent sites for web.config's.

Equally of course, ensure it has read access to your virtual directory, though it looks like it is a permissions issue on the parent folder.

It does not seem anything to do with your virtual directory not being an application as you would get a different error: "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS."

For more details see this MS KB article.

Related Topic