Is it possible to extract values from itemgroups i

2019-08-31 05:21发布

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.

标签: tfs
2条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-31 05:30

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.

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.

查看更多
不美不萌又怎样
3楼-- · 2019-08-31 05:33

An application isn't executing when the TFSBuild.proj file is being executed, unless you're talking about an application not included in the build.

The only way I can think of would be to have a custom MSBuild task which you then pass all the variables into and you do your processing against them.

查看更多
登录 后发表回答