views:

26

answers:

1

In ASP.Net, if we create application from directory, the configuration from root will be inherited to its children application.

www.mywebsite.com
 |
 |-- [blog]
 |-- [forum]
 |-- [others]

so I created these blog, forum application but I don't want configuration from www.mywebsite.com/web.config inherited to blog & forum.

I know i can remove it one by one using <remove> in www.example.com/blog/web.config. But, is there any simpler way to children application just IGNORE everything on its parent configuration?

+2  A: 

You have the 'inheritInChildApplications="false"'

Also, instead of the <remove name='lalala'> you can use the <clear /> to remove all the items in a section. Not perfect but easier.

F.Aquino
where to put option inheritInChildApplications="false" ? I put it in root, but child application still read root config
Anwar Chandra
here's an example: http://www.jaylee.org/post/2008/03/Prevent-ASPNET-webconfig-inheritance-and-inheritInChildApplications-attribute.aspx
F.Aquino