Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
对于spring资源uri,使用xpath进行Web.config转换失败_Xpath_Web Config_Transformation_Xdt Transform - Fatal编程技术网

对于spring资源uri,使用xpath进行Web.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

我的vs2010 web.config文件中有以下部分。我需要在调试环境中的每个资源uri中用/bin/config/替换/bin/。我试图在web.debug.config中使用xdt:transformation和locator,而在web.release.config中不需要任何可以保持不变的转换更改

    <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(…”,实际的转换对我起到了作用