문제

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

도움이 되었습니까?

해결책

<connectionStrings xdt:Transform="Replace">  
<clear/>  
<add name="Abc" connectionString="bla bla bla" providerName=""/>  
</connectionStrings>  
</configuration>  
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top