Question

So I have an website, call it web site A, which is developed by an internal dev team. There's a second team developing another website, call it web site B, which need to essentially extend the behaviour of site A. This includes configuration.

So Web site B needs it's own site wide web.config. But because it needs to make use of features from Site A (Without having to merge/copy code, but maybe copying config) it needs to be able to look for configuration settings in it's own web.config, and then if not present fall through to the web.config of Site A to find the necessary setting.

Is there a way to do this out to box?

I'm aware of configuration hierarchies, and being able to pull out configuration in to separate files e.g. using configSource="foo.config", or locations. However, this doesn't solve the problem. This works in scenarios where you know you want overrides, say app specific connection strings, but doesn't work where you need to extend settings, say by taking all appsettings from Site A, plus three extra app settings from B.

Other considerations, developers for Site A cannot see anything from Site B. Site B source code/configuration is locked down to a specific group of people. Dev's on Site B can see code for site A.

Any thoughts?

Was it helpful?

Solution

Use web.config transofrmation, get some ideas from http://blogs.msdn.com/b/webdev/archive/2009/05/04/web-deployment-web-config-transformation.aspx

this is exactly what you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top