【问题标题】:Accessing other XML value from YUIBuild file从 YUIBuild 文件访问其他 XML 值
【发布时间】:2013-04-18 23:55:57
【问题描述】:

我已经集成了 YUI MSBuild 用于缩小过程。在为 YUI 定义的 Build xml 文件中,我想从 xml 文件访问其他属性。

我在项目中的 xml 文件中定义了版本号

<add key="VersionNumber" value="1000"/>

假设我在 sample.xml 中有上述密钥,我如何从 MSBuild 项目文件中访问它

我可以这样做吗

<ItemGroup>
    <Content Include="constants.xml"/>
</ItemGroup>

Message Text="The output file value @(VersionNumber)"/>  

如有任何帮助,将不胜感激

【问题讨论】:

    标签: c# asp.net visual-studio-2010 msbuild yui


    【解决方案1】:

    我找到了解决方案,并认为它会有所帮助。我使用了xml读取并得到了它,我使用了http://msbuildtasks.tigris.org/

    示例代码,但我的代码不同

     <XmlRead 
      XPath="/add/@connectionString"
      XmlFileName="app.config">
        <Output TaskParameter="Value" PropertyName="MyConnectionString" />
    </XmlRead>
    <Message Text="MyConnectionString: $(MyConnectionString)"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      • 2021-07-22
      • 2017-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-21
      相关资源
      最近更新 更多