3

I have a website and a sub website. Now I am facing problem that is my sub website's web.config file is inheriting parent website's web.config file.
My parent website's web.config file has some <configSections> and my sub website does not need these <configSections>.
How can I do this ? I try to search net but find nothing helpful.

Anderson
  • 1,219
  • 2
  • 12
  • 12

1 Answers1

1

Yes, you can specify allowOverride in the parent web.config in a location section to allow child web.config values to override the parent ones.

You can also set inheritInChildApplications to false so that your sections aren't automatically inherited into the child web.config.

scottm
  • 27,829
  • 22
  • 107
  • 159
  • Thanks for quick reply, but there is a problem I can't change or modify parent web.config (there are some issues). can we do some in sub web.config to achieve our goal? – Anderson Feb 10 '12 at 20:48
  • No, you can't. A work around might be to just add the unneeded config sections to your child web.config. – scottm Feb 10 '12 at 20:51