如何使用 XmlPeek 任务? [英] How to use XmlPeek task?

查看:13
本文介绍了如何使用 XmlPeek 任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在 http://msdn.microsoft.com/en-us/library/ff598684(v=VS.100).aspx但我不能在我的 MSBuild 脚本中使用它.如果你以前用过这个,请告诉我怎么用!

I've read in the MSDN MSBuild Task Reference about XmlPeek task at http://msdn.microsoft.com/en-us/library/ff598684(v=VS.100).aspx but I cannot use it in my MSBuild script. If you have used this before, please show me how!

推荐答案

XmlPeek 任务仅适用于 .NET 4 的 MSBuild.所以您需要使用 MSBuild v4.0 并在您的 msbuild 文件中指定您正在使用的工具版本.

The XmlPeek task is only available in MSBuild for .NET 4. So you need to use MSBuild v4.0 and specify in your msbuild file the tool version you are using.

这是一个示例项目文件,我们正在其中查找消息节点.

Here a sample project file, where we are looking for the message node.

  <Target Name="TestXmlPeek">
    <XmlPeek Namespaces="&lt;Namespace Prefix='msb' Uri='http://schemas.microsoft.com/developer/msbuild/2003'/&gt;"
             XmlInputPath="$(MSBuildProjectFile)" 
             Query="/msb:Project/msb:Target[@Name='TestXmlPeek']/msb:Message">
      <Output TaskParameter="Result" ItemName="Peeked" />
    </XmlPeek>

    <Message Text="@(Peeked)"/>
  </Target>
</Project>

这篇关于如何使用 XmlPeek 任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆