Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to completely negate a "higher" web.config in a subfolder?

Is it possible to completely negate a web.config in a subfolder?

Obviously, I have a web.config in the root.

If I have a subfolder called "MyApp", can I write a bunch of code in there and have it run without any reference to the web.config at root? It would have its own web.config, and wouldn't even reference the "higher" web.config in root.

What I'm looking for is complete App isolation. I'd like to be able to write an app in a subfolder of an existing site, which ignores the entire web.config hierarchy above it -- the app would an island all to itself.

I know I can use the "clear" element, but is that the best way? Just put a "clear" under every top level element? Just wondering if there's another way.

Duplicate of Will a child application inherit from its parent web.config?

like image 709
Deane Avatar asked Apr 23 '09 22:04

Deane


1 Answers

On the web.config file in the root directory, wrap the <system.web> element with the following element: <location path="." inheritInChildApplications="false"></location>

Check out this link for a reference:

http://www.jaylee.org/post/2008/03/Prevent-ASPNET-webconfig-inheritance-and-inheritInChildApplications-attribute.aspx

like image 186
Joe.Ingalls Avatar answered Sep 22 '22 04:09

Joe.Ingalls