代码之家  ›  专栏  ›  技术社区  ›  Fabian Vilers

VS 2010 web.config转换

  •  0
  • Fabian Vilers  · 技术社区  · 15 年前

    我需要有关web.config转换的帮助,因为我正在尝试执行一些没有文档记录的操作。我的web.config有一个空的connectionStrings元素。

    在debug中,我希望转换工具向connectionStrings元素添加configSource=“file.local”。但在发行版中,我希望它添加一个connectionString元素。

    总之,我有

    <connectionStrings>
    </connectionStrings>
    

    我需要把它转换成

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

    以及:

    <connectionStrings>
    <clear/>
    <add name="Abc" connectionString="bla bla bla" provider="xxx" />
    </connectionStrings>
    

    有人做过这个吗?

    提前谢谢,

    费边

    1 回复  |  直到 13 年前
        1
  •  1
  •   Fabian Vilers    15 年前
    <connectionStrings xdt:Transform="Replace">  
    <clear/>  
    <add name="Abc" connectionString="bla bla bla" providerName=""/>  
    </connectionStrings>  
    </configuration>