views:

298

answers:

1

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

<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

+1  A: 
<connectionStrings xdt:Transform="Replace">  
<clear/>  
<add name="Abc" connectionString="bla bla bla" providerName=""/>  
</connectionStrings>  
</configuration>  
Fabian Vilers