Eliminating web.config duplication

Comotose

Member
Joined
Mar 8, 2010
Messages
23
Programming Experience
1-3
In incorporating a few aspx pages (created by someone else) into an existing website that is mostly written in classic asp, I have to have a local web.config file in the /sub/sub/sub/ folder where the aspx and aspx.vb files are ultimately located.

I note there is a lot of duplication between the main root web.config and the web.config in the subfolder.

This has caused a few problems. For example I have already had to comment out the line <authentication mode="Windows"/> from the subfolder web.config to get rid of an error.

So I was wondering...

In the interests of being neat and tidy, would it be wise to go through the web.config file that is in the /sub/sub/sub/ folder and remove any lines/sections that are just duplicates of lines/sections in the web.config file in the root folder?

Seems logical to me, but as I'm very new to .NET I don't want to risk creating future problems for myself.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,412
Location
Norway
Programming Experience
10+
Normally that is not a problem because that is how the configuration file hierarchy is supposed to work: ASP.NET Configuration File Hierarchy and Inheritance
Removing higher level configuration could be a problem for other apps that use that without override. Removing lower level overrides could similar be a problem if at some point the higher level configuration was changed, which would take effect on each app not having more specific settings. To do that you would need a clear picture of what settings each app needs and at what level these are applied, and also control over changes that may be applied later at all relevant levels.
 
Top Bottom