Visual studio 2012 web.config转换无法正常工作
我们在VS 2012中创建了一个网站。我们右键单击了web.config文件,选择了“添加配置转换”,并创建了Visual studio 2012 web.config转换无法正常工作,visual-studio-2012,web-config,Visual Studio 2012,Web Config,我们在VS 2012中创建了一个网站。我们右键单击了web.config文件,选择了“添加配置转换”,并创建了web.config的发行版和调试版 在它们中,我们在调试版本和发布版本的web.config中向部分添加了一些新条目: <appSettings> <add key="username" value="user" xdt:Transform="Insert" xdt:Locator="Match(key)"/> <add key="pa
web.config
的发行版和调试版
在它们中,我们在调试版本和发布版本的web.config
中向
部分添加了一些新条目:
<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
中的
元素中。我猜插入和定位器不能一起工作。如果您正在进行插入,则不会尝试在任何内容上匹配它。如果您试图进行替换或设置某些属性,则需要进行定位器匹配。如果您正在进行插入,则不需要查找(使用定位器),因为它是全新的
简而言之,如果这是一个新条目,请保留Insert,删除Locate
有道理吗