【发布时间】:2013-08-06 01:25:30
【问题描述】:
我们在 VS 2012 中创建了一个网站。我们右键单击了 web.config 文件并选择了“添加配置转换”并创建了 web.config 的发布和调试版本。
在其中,我们在web.config 的调试和发布版本中的<appSettings> 部分添加了一些新条目:
<appSettings>
<add key="username" value="user" xdt:Transform="Insert" xdt:Locator="Match(key)"/>
<add key="password" value="pwd" xdt:Transform="Insert" xdt:Locator="Match(key)"/>
<add key="GET" value="https://somewhere.com/url1" xdt:Transform="Insert" xdt:Locator="Match(key)"/>
<add key="POST" value="https://somewhere.com/url2" xdt:Transform="Insert" xdt:Locator="Match(key)"/>
</appSettings>
我们已经尝试了各种转换类型,包括“插入”和“设置属性”。到目前为止,还没有产生在构建后将这些新的 appSettings 条目添加到 web.config 的预期结果。
我们是否需要在web.config 中为它们添加占位符条目,还是我们缺少其他步骤?
[编辑] 上面的 appSettings 包含在 web.config 的调试和发布版本中的 <configuration> 元素中。
【问题讨论】:
标签: visual-studio-2012 web-config