views:

51

answers:

4

I am currently putting a new version of my site online. I would like to retain the old site (for purposes of read only access) and have been directed to place it within a subfolder inside the directory where the site use to live. e.g.

www.example.com needs to be moved to www.example.com/old and the new site needs to be moved to www.example.com

Unfortunately I get the classic ASP.NET error when attempting to piggy back sites that each have their own web config.

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.

How can I compeletly seperate off the new site and access it via. www.example.com/old without ASP.NET trying to trickle down through my directories and find the main sites web.config?

Thanks!

+1  A: 

Giving the site its own AppPool should work.

You can do this by creating an AppPool and then on the virtual directory in IIS setting the app pool to your new one in the properties.

Rob Stevenson-Leggett
A: 

You may try the following setting in the site contained in the virtual dir:

<location inheritInChildApplications="false">

Rick Strahl has the same problem and describes his experiences on his blog.

Didn't try it out myself, but found other blog articles which use it successfully with IIS6.

marapet
Right -- that's what I'm doing already.
George
sorry, I re-read the question title, and figured out that you are using a virtual dir... Found an other solution, should work on IIS6, too.
marapet
A: 

Make sure that the virtual directory is an application and not just a virtual directory.

Ben Robinson
A: 

I've tried both creating a new App Pool on the site. That's didn't work -- same errors. I also added the inheritChildApplications attribute directive in my web.config. That didn't work either. The only way I have been able to achieve what I needed was to add a new subdomain in an entirely new folder and put a redirect to it in my www.example.com/old page to old.example.com.

It's not what I was looking to do, but it solved the issue.

George