1

We have a Continuous Deployment system which allows us to deploy to different environments.

In the default Web.config, we have the following xml line commented out:

<!--<add key="EventLogger.MessageSize" value="4096" />-->

In a particular QA environment I need the previous message to be overwritten by what's in the Web.QA1.config file:

<add key="EventLogger.MessageSize" value="1024" xdt:Transform="Insert" xdt:Locator="Match(key)"/>

I've tried a couple of different things, including xdt:Transform="SetAttributes", but nothing seems to work. When the code is deployed to the QA environment, the EventLogger.MessageSize key is still completely commented out. I need this key commented out in the default Web.config, but it also needs to be uncommented out for QA environments.

Am I using the wrong value for xdt:Transform or something?

Max
  • 808
  • 11
  • 25
  • Does it have to actually remove the comment or merely ensure that the desired value is present? [There are XPath selectors for comments](https://stackoverflow.com/questions/1759672/selecting-comments-by-their-inner-xml-in-xpath-xsl), or you could [just remove and insert after](https://stackoverflow.com/questions/5732681/is-there-any-way-to-do-a-replace-or-insert-using-web-config-transformation), depending on your answer.. – stephen.vakil Nov 02 '17 at 20:13
  • @stephen.vakil The new value just needs to be inserted. It is ok for the previous value to continue existing as a comment. – Max Nov 02 '17 at 20:46

0 Answers0