对于spring资源uri,使用xpath进行Web.config转换失败
我的vs2010 web.config文件中有以下部分。我需要在调试环境中的每个资源uri中用/bin/config/替换/bin/。我试图在web.debug.config中使用xdt:transformation和locator,而在web.release.config中不需要任何可以保持不变的转换更改对于spring资源uri,使用xpath进行Web.config转换失败,xpath,web-config,transformation,xdt-transform,Xpath,Web Config,Transformation,Xdt Transform,我的vs2010 web.config文件中有以下部分。我需要在调试环境中的每个资源uri中用/bin/config/替换/bin/。我试图在web.debug.config中使用xdt:transformation和locator,而在web.release.config中不需要任何可以保持不变的转换更改 <context> <resource uri="~/bin/file1.config.xml" /> <resourc
<context>
<resource uri="~/bin/file1.config.xml" />
<resource uri="~/bin/file2.config.xml" />
<resource uri="~/bin/file3.config.xml" />
</context>
我尝试了几种不同的方法,但在web.debug.config中没有任何效果。这是我所拥有的不起作用的东西。请帮忙
<resource uri="~/bin/Config/file1.config.xml" xdt:Transform="Replace" xdt:Locator="Condition(//resource[@uri='~/bin/file1.config.xml']) "/>
<resource uri="~/bin/Config/file2.config.xml" xdt:Transform="Replace" xdt:Locator="Condition(//resource[@uri='~/bin/file2.config.xml']) "/>
<resource uri="~/bin/Config/file3.config.xml" xdt:Transform="Replace" xdt:Locator="Condition(//resource[@uri='~/bin/file3.config.xml']) "/>
更新:我需要能够通过visual studio IDE调试我的网站 1)首先要能够从visual studio内部运行转换,请在调试、发布和配置文件之间切换找到此StackOverflow线程
2) 通过将“xdt:Locator=“条件”更改为“xdt:Locator=“XPath(…”,实际的转换对我起到了作用