Questions tagged [xdt-transform]

XML-Document-Transform (xdt) is a technique used in Microsoft Visual Studio for modifying Web.config files, typically for debug and release deployment scenarios.

XML-Document-Transform (xdt) is based on a principle of base config file (App.config or Web.config) and one or more Transformation files that specify how the original config file should be changed upon deployment.

XDT reduces redundancy of config files by storing most of configuration data in a base config file, while Transformation files only contain differences that are required for each particular deployment scenario.

100 questions
199
votes
4 answers

Is there any way to do a "Replace Or Insert" using web.config transformation?

I'm using web.config transformation as described in the below post in order to generate configs for different environments. http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html I can do a "Replace" transformation…
Chris Haines
  • 6,445
  • 5
  • 49
  • 62
38
votes
2 answers

How to do a web.config transform for smtp?

I have this in my root web.config
chobo2
  • 83,322
  • 195
  • 530
  • 832
31
votes
1 answer

What is the right xdt:Locator parameter to transform this node?

I have the following in my app.config file. I am using Slow Cheetah and just want to replace replace configuration/entityFramework/defaultConnectionFactory/parameters/parameter so it points to a diff server. ie value-data source=some-server.... …
etoisarobot
  • 7,684
  • 15
  • 54
  • 83
31
votes
8 answers

SlowCheetah not transforming file on build

I have a project I am trying to use SlowCheetah for. I have created my config file (Test.web.config) and all the transformations I want to use (Debug_Mock.config, Debug_SQL.config, Release) in my Build configuration I have a post-build event is…
26
votes
1 answer

XDT Transform: InsertBefore - Locator Condition is ignored

I have a web.config file in which I need to either insert the element or manipulate children of that node if it already exists. If it already exists I don't want to insert it again (obviously, as it is only allowed to exist…
sebastiaan
  • 5,870
  • 5
  • 38
  • 68
20
votes
2 answers

Is there a way to "insert" a new section into Web.Config using transforms?

In my Web.Config I have the following **some code** **some code** How do I transform it so I can inject a new sub section for…
Paul Brown
  • 4,926
  • 9
  • 32
  • 44
15
votes
1 answer

xdt transform locator that matches subnode content

i have the following node in web.config: ... core master ... i want to remove the…
lurscher
  • 25,930
  • 29
  • 122
  • 185
14
votes
4 answers

Transform app.config for 3 different environment

I need to be able to transform my app.config file using msbuild. I can transform the file if it is called app.DEBUG.config or app.Release.config, but I cannot if I add one called app.PROD.config. Using regular XDT transforms msbuild recognizes…
cmluciano
  • 527
  • 1
  • 6
  • 15
13
votes
1 answer

xdt transforms for configuration files other than web.config

I've been looking into xdt transforms for visual studio 2010 and they seem quite neat for keeping track of environment changes, but all it mentions is for applying it to web.config. I'm working on a sitecore project which has other configuration…
lurscher
  • 25,930
  • 29
  • 122
  • 185
12
votes
2 answers

xdt:Transform="Insert" not working for in

I have the following transform written in the live config of my web.config.
11
votes
5 answers

Adding comments using XDT-Transform

I am using XDT-Transform in Visual Studio 2010 to generate multiple config files. Xml transformation is working fine. But I cannot seem to find way to carry comments from an xml transform file to final file. Just like there is Insert transform for…
user1990594
  • 165
  • 2
  • 7
10
votes
2 answers

Web Config Transformation Syntax

I've been following the MSDN guide for Web Config Transformation and by-and-large have had success with it. However, one line of my web config is giving my troubles and I can only assume it's because I'm misunderstanding the guide and using the…
Jonathan
  • 420
  • 3
  • 13
9
votes
1 answer

XDT Transforms - Transforming the transform

I am creating a nuget package where part of the result of installing the package is to modify my web.release.config. I have no problem inserting elements into this file with my web.release.config.install.xdt, but I need to keep the xdt:Transform…
Kelly
  • 91
  • 2
9
votes
2 answers

How do I transform replace a dependentAssembly in web config?

So I'm trying to replace a dependentAssembly when someone adds my nuget package to their code. The assembly I want to change is:
Xepos
  • 167
  • 1
  • 15
8
votes
1 answer

Web.config transformation: how to apply a transformation to all node matching a Locator expression?

I've recently discovered the web.config automatic transformation in the web deploy tool of visual studio 2010. It's working well, but I have a scenario I can't seem to get working. Assume I have the following root Web.config
Clement
  • 3,990
  • 4
  • 43
  • 44
1
2 3 4 5 6 7