xdt-transform

xdt transforms by a child node attribute

非 Y 不嫁゛ 提交于 2019-12-11 07:48:22
问题 I'm trying to create transform that will remove a node by it child node based on this answer without success so that: <?xml version="1.0"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Net.Http1"

Clearing out xdt element if it has no children

荒凉一梦 提交于 2019-12-10 13:19:59
问题 So I'm starting to play with nuget and it's web.config install/uninstall.xdt values. My question would be, Is there and xdt:Transform that will clear out empty elements. I didn't find anything here. https://msdn.microsoft.com/en-us/library/dd465326%28v=vs.110%29.aspx Here's my example. My current Web.config.install.xdt looks like this <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.web> <compilation xdt:Transform="InsertIfMissing"> <assemblies xdt

Adding comments using XDT-Transform

≡放荡痞女 提交于 2019-12-08 16:08:51
问题 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 adding config settings, is there anyway to add comments? Without comments I may have to give up on the whole transform approach. 回答1: I've found a possible solution for you. It is only necessary to denote something as being an Insert at the highest

Duplicate Connection String Error

瘦欲@ 提交于 2019-12-08 08:08:01
问题 I have a website deployed in a server. One day it threw an error saying the connection string name is already added. I checked the web.config file and it has only one entry in that name. I removed the entry from the config. Now the website worked well and fetched data from database. Note: When I changed the name of the config file it show error. I think, the issue is – the connectionstring part is cached in memory. Is it so? How can we overcome this unwanted behavior? Config Files in Source

Generating xml document transformation for Staging and Production web.config file

痞子三分冷 提交于 2019-12-06 01:24:42
We are planning to use XDT concept for automating the web.config settings in Staging and Production. We already have the web applications created long time back using Visual Studio in c#.Net. All our applications have a web.config already inside them (under which we have web.debug.config and web.release.config) I have taken the web.config from current staging and PROD environments. Now do I create the web.PROD.config and web.Staging.config xdt (xml transform) files(based on the backups I have taken from the current Staging and PROD environments) and also make sure the web.config which is

Trying to replace XML element element using XDT and XPath locator

自作多情 提交于 2019-12-01 08:07:52
Hi I am trying to replace the <cron-expression> using VS2012 XDT by using the following transform on a quartz.net job description file. I have tested the XPath locator using an online tester and it returns 'what i think i need'. Any help is appreciated. <schedule> <trigger> <cron xdt:Locator="XPath(//job-scheduling-data/schedule/trigger/cron[name='crontriggername2'])" > <cron-expression xdt:Transform="Replace">***some data***</cron-expression> </cron> </trigger> </schedule> for the sample XML file (Quartz.net) <job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData"

xdt transform locator that matches subnode content

爷,独闯天下 提交于 2019-11-30 11:46:24
i have the following node in web.config: <configuration> ... <scheduling> <agent> <param desc="database">core</param> </agent> <agent> <param desc="database">master</param> </agent> </scheduling> ... </configuration> i want to remove the whole <agent> node with the child param node with master content. more or less my xdt transform node looks like: <configuration> ... <scheduling> <agent xdt:Transform="Remove" xdt:Locator="XPath(./param[@desc='database']/??????)" /> </scheduling> ... </configuration> as you see, i have no idea how to match with the node content string. What do i need to add in

SlowCheetah not transforming file on build

无人久伴 提交于 2019-11-30 01:27:26
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 supposed to copy the transformed file into another directory but the file cannot be found (error xcopy exited with code 4) SlowCheetah doesn't seem to be transforming the file and placing it in the output directory (bin folder) like I would expect. Does anyone have any ideas as to why it is not happening, maybe a setting somewhere? FYI: This process

XDT Transform: InsertBefore - Locator Condition is ignored

懵懂的女人 提交于 2019-11-28 09:00:00
I have a web.config file in which I need to either insert the <configSections /> 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 once). Normally, that would not be a problem, however: If this element is in a configuration file, it must be the first child element of the element. Source: MSDN . So if I use xdt:Transform="InsertIfMissing" the <configSections /> element will always be inserted after any existing child elements (and there are always some), violating the above

XDT Transform: InsertBefore - Locator Condition is ignored

我的梦境 提交于 2019-11-27 02:33:59
问题 I have a web.config file in which I need to either insert the <configSections /> 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 once). Normally, that would not be a problem, however: If this element is in a configuration file, it must be the first child element of the element. Source: MSDN. So if I use xdt:Transform="InsertIfMissing" the <configSections /> element will always be