是否可以在构建期间从 TFSBuild.proj 中的项组中提取值 [英] Is it possible to extract values from itemgroups in TFSBuild.proj during a build

查看:26
本文介绍了是否可以在构建期间从 TFSBuild.proj 中的项组中提取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在构建期间提取 C# 应用程序中 TFSBuild.proj 文件的项组集合中定义的值.有人可以告诉我如何做到这一点.

I want to extract values defined in an item group collection of TFSBuild.proj file in a C# application during a build . Can someone give me an idea as to how this can be done.

推荐答案

您可以使用 执行 MSBuild 任务 来调用您的 C# 应用程序.在您发送的命令行中,您可以包含 @(ItemGroup) 并查看它是如何序列化到应用程序的参数列表中的.

You could use the Exec MSBuild task to call your C# application. In the command line you send, you could include the @(ItemGroup) and see how it is serialized to the app's parameter list.

您也可以考虑编写一个自定义 MSBuild 任务,使用您的 C# 应用程序来处理该信息.然后,您可以让任务的公共属性之一是任务项数组或字符串数​​组等,这些属性很容易通过标准 MSBuild 元素语法提供.

You could also consider authoring a custom MSBuild task instead, using your C# app, to work with that information. You could then have one of the public properties on your task be an array of task items, or an array of strings, etc., easy enough to provide through the standard MSBuild element syntax.

这篇关于是否可以在构建期间从 TFSBuild.proj 中的项组中提取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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