【问题标题】:VS 2010 web.config transformationVS 2010 web.config 转换
【发布时间】:2011-03-02 15:08:51
【问题描述】:

我需要有关 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>

有人做过吗?

提前致谢,

法比安

【问题讨论】:

    标签: xml visual-studio web-config web-config-transform


    【解决方案1】:
    <connectionStrings xdt:Transform="Replace">  
    <clear/>  
    <add name="Abc" connectionString="bla bla bla" providerName=""/>  
    </connectionStrings>  
    </configuration>  
    

    【讨论】:

      猜你喜欢
      • 2011-02-28
      • 1970-01-01
      • 2017-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-15
      • 1970-01-01
      • 2023-04-08
      相关资源
      最近更新 更多