MSBuild task to execute an external MSBuild file?

You can use the MSBuild task to build a target in another MSBuild project.

You can use the MSBuild task to build a target in another MSBuild project. You can also put the target in an external . Targets file that is imported by both MSBuild projects and use the CallTarget task to build it.

Update: To execute an external command, use the Exec task.

Ahh! I knew there had to be a better way. I hadn't come across the MSBuild task before :) – Slace Oct 1 '09 at 5:20 How do you use MSBuild Task to execute an external file?

Could you show how to do that? – Adam Oren Mar 3 '10 at 6:31.

It's not just prettier to use the task rather than . It means that the single MSBuild process knows about all the projects being built, and there's no collisions; a particular project can't be being built by two threads at once. That's usually vital if you are building with "/m".

There's some other advantages too, such as there being one set of loggers for the whole build.

Response to Adam Oren's comment: Here's an example to execute an external file - in this case, it launches nunit. The %22 is for escaping, it means " so you can have spaces in your executable path. You don't need to use variables like I did, but I find that it makes your scripts more portable.

$(NUnit_Install_Directory) is defined as c:\Program Files\NUnit 2.5.3.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions