VS 2010 web.config transformation

Posted by Fabian Vilers on Stack Overflow See other posts from Stack Overflow or by Fabian Vilers
Published on 2010-06-11T11:40:51Z Indexed on 2010/06/11 11:42 UTC
Read the original article Hit count: 407

Filed under:
|
|

Hi all,

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

<connectionStings>
</connectionStings>

And I need to transform it to

<connectionStings configSource="file.local">
</connectionStings>

And to:

<connectionStings>
<clear/>
<add name="Abc" connectionSting="bla bla bla" provider="xxx" />
</connectionStings>

Anybody has done this yet?

Thanks in advance,

Fabian

© Stack Overflow or respective owner

Related posts about Xml

Related posts about visual-studio