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() { ...
Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.