views:

1085

answers:

2

I have a .Net 1.1 web application sitting in a folder called C:\inetpub\wwwroot\MyTestApp, where 'MyTestApp' is a virtual directory and is configured to be on ASP.Net version 1.1.4322 in IIS 5.1.

In the root directory (C:\inetpub\wwwroot) there is a web.config file for a .Net2.0 application, because the root folder contains some web pages written in .Net2.0.

Whenever I try to access 'MyTestApp' though I get an error...

Parser Error Message: Unrecognized configuration section 'connectionStrings'

Source File: c:\inetpub\wwwroot\web.config    Line: 17

The .Net1.1 application in the MyTestApp folder is trying to access the web.config file in the root folder, and getting upset because it is on a different version. How can I tell the MyTestApp folder NOT to use the web.config file in the root folder, but instead just use the web.config in its own folder?

Is such a thing possible, or is nesting a .Net 1.1 application in a sub-folder under a .Net 2.0 application a no-no?

+1  A: 

I think you need to configure your virtual directory for your 1.1 app as a "application" directory.

I am on IIS7, so I am providing this from memory!

If you right click it in IIS, and then click "Create Application" that should do the trick.

Web.config is always read based on proximity (closest to application first, up through folder structure, right up to Machine.config).

Hope this helps.

Edit

Checkout the guide on MSDN on creating Virtual Directories. It also touches on creating Applications.

Rob Cooper
Alas, it is indeed already created as an application. Tts Application protection level is also set to High (Isolated).
Tim C
When you access the virtual directory properties, and click the ASP.NET tab. There should be a button in there to edit the configuration, what configuration file information is listed when you do?
Rob Cooper
A: 

You want to use the InheritInChildApplications setting in the root web.config and set this to false.

Dave Anderson
more info related to this suggestion: http://stackoverflow.com/questions/367282/disable-web-config-inheritance
Frank Schwieterman