How to find if a target is present in a project file or not  
Author Message
Sajjad Akhter





PostPosted: Visual Studio MSBuild, How to find if a target is present in a project file or not Top

I am working on auto building references, for each refrence i expect there will a target named same as refrence.

So i will invoke all those targets in my BeforeResolveTargets.

Is there a way i can find out what are the targets list. So i will only try to get those refrences built those have target named same as reference.

another question how can i check memeber ship of a vlaue in a list.

etc

Thanks,

sajjad



Visual Studio1  
 
 
Jay Shrestha





PostPosted: Visual Studio MSBuild, How to find if a target is present in a project file or not Top

Hi,

Currently we have no support for querying the list of targets from within a project file. The only other option I can think of would be to use the MSBuild object modal - Project.Targets collection. For more information you can review msdn help files in Microsoft.Build.Engine.

As for the second question, we also currently do not have support to do a contains in an item list. The only way you can itterate through an item list is by using task or target batching (%item.identity) == 'A'.

If you have any additional questions please feel free to email me.

Thanks,

Jay Shrestha