views:

291

answers:

2

I am creating an MSBuild task that will generate one or more files, I have a Task with an [output] property that is of type ITaskItem[]. My question is, do I need to implement that interface myself or is there a class I can use already?

I want them to be Compile task items that get added to the list of files to compile.

+1  A: 

It turns out there is a TaskItem class already. It's pretty general but should work just fine. If you set the ItemName="Compile" on the output element in your targets file it will create them as Compile items and add them to the collection. No problem

justin.m.chase
You can also create a nested ItemGroup below your task that includes or removes your output from item groups.
justin.m.chase
A: 

I still can't figure out how to get the project CodeDomProvider though...

justin.m.chase
Related issue http://stackoverflow.com/questions/395313/how-can-i-get-the-current-codedomprovider-in-an-msbuild-task
Norman H