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.
views:
52answers:
2An 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.
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.