VS 2010 web.config transformation
-
26-09-2019 - |
Question
I need help on web.config transformation as I'm trying to do something not documented. My web.config has an empty connectionStrings element.
In debug, I'd like the transformation tool to add a configSource="file.local" to the connectionStrings element. But in release, I'd like it to add a connectionString element.
So, to summarize, I have
<connectionStrings>
</connectionStrings>
And I need to transform it to
<connectionStrings configSource="file.local">
</connectionStrings>
And to:
<connectionStrings>
<clear/>
<add name="Abc" connectionString="bla bla bla" provider="xxx" />
</connectionStrings>
Anybody has done this yet?
Thanks in advance,
Fabian
Solution
<connectionStrings xdt:Transform="Replace">
<clear/>
<add name="Abc" connectionString="bla bla bla" providerName=""/>
</connectionStrings>
</configuration>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow