我需要有关 web.config 转换的帮助,因为我正在尝试做一些没有记录的事情。我的 web.config 有一个空的 connectionStrings 元素。
在调试中,我希望转换工具将 configSource="file.local" 添加到 connectionStrings 元素。但在发布时,我希望它添加一个 connectionString 元素。
所以,总而言之,我有
<connectionStrings>
</connectionStrings>
我需要将其转换为
<connectionStrings configSource="file.local">
</connectionStrings>
并:
<connectionStrings>
<clear/>
<add name="Abc" connectionString="bla bla bla" provider="xxx" />
</connectionStrings>
有人做过吗?
提前致谢,
费边