Is there a way to make the NuGet package convert a configuration file? For example, when I want my NuGet package to edit a file web.config, I create a file web.config.install.xdt. But what if I want my NuGet package to edit a file web.config.debug?
I tried to create the file web.config.debug.install.xdt, but ran into one problem: I cannot force the transform to insert attributes that are themselves xdt transform attributes. Sort of:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt1="http://schemas.microsoft.com/XML-Document-Transform">
<system.serviceModel >
<client xdt1:Transform="Insert">
<endpoint address="http://blah.blah" binding="basicHttpBinding" contract="Test.Contract"
name="TestWs" xdt:Transform="Replace" xdt:Locator="Match(name)"/>
</client>
</system.serviceModel>
</configuration>
(I tried changing the xdt namespace, but that didn't help either.)
source
share