Julio C&#233&#59;sar Carrascal

I'm writing a new task for MSBuild and I would like to know if it is a good idea to instantiate and use other tasks inside the Execute() method of another

Apart from setting the Log and BuildEngine properties is there anything else I should do before calling Execute() in the inner tasks

Thanks.



Re: Visual Studio MSBuild Composite Tasks.

Steve St.Jean

Julio,

Like any other development, if you reference a third-party's code in yours you have coupled their task to yours. That means you now have to deploy their assembly along with yours. I would recommend making your custom task as stand-alone as possible and coupling to the other task within the MSBuild project file via shared properties or itemgroups.

- Steve






Re: Visual Studio MSBuild Composite Tasks.

Julio César Carrascal

I'm not using third party tasks. They are all in the same assembly.

In this assembly I have several classes that inherit from ToolTasks that mimic the behavior of some command-line apps that should be used in conjunction. Then, I've written another ITask that should call those same command-line apps in some common patterns. I thought on reusing the ToolTasks in the Execute method of the ITask.

So far it is working correctly but I'd like to know if there are known problems by using ToolTasks inside the Execute method of another Task

Thanks.




Re: Visual Studio MSBuild Composite Tasks.

Steve St.Jean

Ok, sorry... I got the mistaken impression that you were trying to pull in MSBuild standard tasks or third-party custom tasks into your code. In the case you described, I wouldn't expect there to be any issues, but that answer is far from definitive as I've never done what you are asking. You may be crossing virgin territory here. I'd be interested in hearing how your experimentation turns out.

- Steve