O'Reilly logo

Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build by William Bartholomew, Sayed Ibrahim Hashimi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Task Input/Output

When you create custom MSBuild tasks they will most likely need to accept some input and/or provide some output values. Inside your task these are implemented with normal .NET properties that may be decorated with attributes. Don’t confuse these with MSBuild properties. We will first examine a very simple example and then move on to discuss more realistic tasks. Building on the HelloWorld2 task, I’ve created a new task, HelloWorld3, which accepts two input parameters. Those input parameters are FirstName and LastName. The definition of the HelloWorld3 task is shown as follows.

public class HelloWorld3 : Task { [Required] public string FirstName { get; set; } public string LastName { get; set; } public override bool Execute() { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required