Open MrYossu opened 7 years ago
Anyone?
SlowCheetah uses Microsoft.Web.Xdt
to process the XML transforms. Here is the MSDN page for it. I believe the SetAttributes
section is what you are looking for.
Replacing a portion of the value is not supported with XDT out of the box. It is possible to create a custom XDT transform which can replace a portion of an attribute value. I describe how to do this in an old blog post at http://sedodream.com/2010/09/09/extendingxmlwebconfigconfigtransformation.aspx.
With that said, I've never tested using a custom transform with SlowCheetah. Also @jviau and others are in the middle of refactoring the code, so if you get it working now you may need to update a reference later.
All of the examples I've seen of using SlowCheetah involve replacing the full contents of an attribute in a node.
What I want to do is replace part of an attribute value. For example, if my App.config file contains the following...
...then I can add a transform to my App.Release.config file as follows...
...and it will produce the correct output.
However, as I have a lot of these service references, I have lots of entries like the above in the App.config file, with corresponding entries in the App.Release.config file.
What I would really like to do is only have to add one entry to the App.Release.config file that works all of the service entries in the App.config file, ie it transforms localhost:24953 into www.mydomain.co.uk for each node in the file.
Is this possible, or do I have to have a separate entry in my App.Release.config file for every service?