I have a webapp that has 2 different modes, lets say demo mode and no-demo. For each mode I use a diferent set of setting in the web.config file. Also I have developer servers and production servers. I'm using web transformation to create the web.config
for ach of my instances. So I need to transform to demo-dev, demo-prod, no-demo-dev and no-demo-prod.
Instead of having to copy paste the setting that are shared between demo-dev and demo-prod I wiil like to have these settings in one file and then the transformations will change what is not common(like the db connection). Any way of doing that?
I tried creating a demo.config wth all common settings:
<div><testname="Change other values"xdt:Transform="Insert"/></div> <div>....</div> <div></configuration></div> <div></div> <div>This is not working.</div> <div>I also
tried with identities and didn't work either. Any other ideas?</div> <div>(By the way, the app actually have 4 modes, and I need to publish to 3 diferent servers)</div> <div>Thanks</div>
amalborn
0 Points
1 Post
Web transformation - include another transformation
Nov 18, 2012 03:12 AM|LINK
Hi
I have a webapp that has 2 different modes, lets say demo mode and no-demo. For each mode I use a diferent set of setting in the web.config file. Also I have developer servers and production servers. I'm using web transformation to create the web.config for ach of my instances. So I need to transform to demo-dev, demo-prod, no-demo-dev and no-demo-prod.
Instead of having to copy paste the setting that are shared between demo-dev and demo-prod I wiil like to have these settings in one file and then the transformations will change what is not common(like the db connection). Any way of doing that?
I tried creating a demo.config wth all common settings:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="key1" value="value1" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
.....(much more elements here)
</appSetting>
</configuration>
And the in the Web.demo-prod.config I try to call that xml using xi:include:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" >
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="demo.config" />
<div><test name="Change other values" xdt:Transform="Insert"/></div> <div>....</div> <div></configuration></div> <div></div> <div>This is not working.</div> <div>I also tried with identities and didn't work either. Any other ideas?</div> <div>(By the way, the app actually have 4 modes, and I need to publish to 3 diferent servers)</div> <div>Thanks</div>niksv
Contributor
5925 Points
1115 Posts
Re: Web transformation - include another transformation
Dec 19, 2012 06:02 PM|LINK
I think this will suffice: http://vishaljoshi.blogspot.in/2009/03/web-deployment-webconfig-transformation_23.html