【问题标题】:MSBuild Paramaters.xml xpath appsettings file attributeMSBuild Paramaters.xml xpath appsettings 文件属性
【发布时间】:2011-06-28 19:07:54
【问题描述】:

我正在使用 msbuild 创建一个 web 部署包,使用 parameters.xml 文件替换 web.config 设置。

我正在尝试替换 web.config 中的 appsettings 文件属性

这是我的parameters.xml:

<parameter name="ClientConfig" description="Please enter the clients config file name." defaultValue="Niad.config" tags="">
<parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/setting[@name='file']/value" />
 </parameter>

这是我的 Web.config 部分:

<?xml version="1.0"?>
<configuration>
 <appSettings file="Client.config">
 </appSettings>
</configuration>

我知道我写错了 xpath 匹配,我希望有人可以帮助我正确的语法。

【问题讨论】:

  • /configuration/appSettings/@file

标签: visual-studio-2010 xpath msbuild msdeploy


【解决方案1】:

这行得通:

match="/configuration/appSettings/@file"

<parameter name="ClientConfig" description="Please enter the clients config file name." defaultValue="Niad.config" tags="">
<parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/@file" />
</parameter>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-11
    • 2017-02-17
    • 2016-11-04
    • 2017-12-14
    • 2012-02-17
    • 1970-01-01
    • 2012-03-24
    相关资源
    最近更新 更多