xdt-transform

Trying to replace XML element element using XDT and XPath locator

时光怂恿深爱的人放手 提交于 2020-01-11 06:23: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

Web.config partial search and replace

最后都变了- 提交于 2020-01-05 11:37:47
问题 I have App.config file in C# application. I want to partially replace all Keys matching ".UAT" with ".PROD" using xdt tranform. <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <appSettings> <add key="MyParam1.UAT" value="param1"/> <add key="MyParam2.UAT" value="param2"/> <add key="MyParam2.UAT" value="param3"/> </appSettings> </configuration> Here is the output I want <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft

How would I remove Elmah modules from web.config using XML-Document-Transform?

ε祈祈猫儿з 提交于 2019-12-24 10:23:22
问题 In other words, in the following web.config xml, I want to remove all elements with a type attribute that starts with 'Elmah.' <httpModules> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /> <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /> <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" /> </httpModules> I have tried several combinations and structures of the basic transform, with various errors, <add xdt:Locator="XPath([starts-with(@type,'Elmah.')" xdt

xdt:Transform=“Insert” not working for <rewrite> in <system.webServer>

走远了吗. 提交于 2019-12-23 07:05:03
问题 I have the following transform written in the live config of my web.config. <system.webServer> <rewrite xdt:Transform="Insert"> <rules> <rule name="httpsrewrite"> <match url=".*" /> <serverVariables> <set name="SERVER_PORT" value="443" /> <set name="HTTPS" value="on" /> </serverVariables> <action type="None" /> </rule> </rules> </rewrite> </system.webServer> There is no element in my web.config. The transform just does not work. All my other transform (replace for elmah and connection string)

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

我只是一个虾纸丫 提交于 2019-12-19 00:09:11
问题 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 <services> <service name="Service1"> <endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding" contract="Service1" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> <service name="Service2">

xdt transform locator that matches subnode content

我怕爱的太早我们不能终老 提交于 2019-12-18 14:52:27
问题 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> ... <

SlowCheetah not transforming file on build

喜欢而已 提交于 2019-12-18 11:11:50
问题 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.

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

瘦欲@ 提交于 2019-12-18 09:55:45
问题 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 by matching on the key, e.g. <add key="Environment" value="Live" xdt:Transform="Replace" xdt:Locator="Match(key)" /> And I can do "Inserts" e.g. <add key="UseLivePaymentService" value="true" xdt:Transform="Insert" /> But what I would really find

XDT Transforms - Transforming the transform

心不动则不痛 提交于 2019-12-14 03:41:42
问题 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 and xdt:Locator attributes on the elements I am inserting because these transforms will need to be run when the application is built for deployment. So for instance when installing the nuget package I would like to see: <add key="serilog:using" value=

Web Config Transforms are HTML Encoding some of the config and breaking it

别来无恙 提交于 2019-12-11 19:42:14
问题 I have the following: Web.Config (this is a segment of an NLog configuration) <target name="fileAsException" xsi:type="FilteringWrapper" condition="length('${exception}')>0"> ... removed ... </target> This is translated to the following when built with release: <target name="fileAsException" xsi:type="FilteringWrapper" condition="length('${exception}')>0"> ... removed ... </target> As you can see the condition expression has been HTML Encoded resulting in the > replacing the > . This causes