kpollock
kpollock

Reputation: 3989

Any pointers on using C# and the MSBuild object model to build .Net assemblies?

OK, I'll confess I just HATE MSBuild files, and would rather control the process of building.Net C# / Website code via a nice language with actual decision structures etc, like...ohh, I know, C#.

I know there is an MSBuild object model since that's what you use to write custom tasks.

Any pointers on using that doing what I want? Not having much luck wording my searches (or possibly I am just crazy and nobody does it this way)

Upvotes: 3

Views: 297

Answers (2)

Hans Passant
Hans Passant

Reputation: 941208

Creating a task doesn't have anything to do with the sequencing of the tasks as directed by a .targets file. You can execute tasks from a C# program as well, use their Execute() method. You'll probably find this to be largely an exercise in property assigning, tasks normally have a lot of them. After a while, you'll wonder why you wouldn't just use a data file. In xml format.

Upvotes: 1

Brian Rasmussen
Brian Rasmussen

Reputation: 116401

I am doing some custom tasks for our build jobs at the moment, and I have found the book Using MSBuild and Team Foundation Build very useful. It has several examples on how to customize the build process using custom tasks.

Upvotes: 4

Related Questions