sharp bites

standing on the shoulders of giants

nant vs. msbuild

Yes, this is yet another post on nant vs. msbuild.
I had to choose which one of the two to use at the company I work for. After doing a lot of research, it looks like there aren’t many differences between them. Here are some of the pro/cons I found:

- msbuild comes from Microsoft (yes, that usually matters to some (not all, like me) people)
- msbuild is already installed in every .net developer machine (not a big deal)
- msbuild has probably better integration with VS build process
- msbuild supports parallel builds since .net 3.5 (not that it really matters, since you usually use msbuild from nant to build your projects, anyway).
- msbuild evaluates filesets at startup. This seems to cause some headaches when you want to manipulate files generated during the building process.
- you can redefine targets in msbuild. in nant you can define general targets and just make your build files call those (or create and use hooks, which is a solution I don’t really like).
- nant has more examples and better documentation
- there is much more information about nant than about msbuild on the web, according to google trends and google search results (both in english and spanish)
- nant has some more tasks, but with msbuildtasks/sdc tasks it’s on par with nant and nantcontrib.
- nant helper functions and expressions are better ¿?
- I like nant syntax better.
- nant is more mature, msbuild was born as an alternative ( :D) to nant for companies with ridiculous “no open source here” and Microsoft “I can’t support an open source project I don’t control” way of life.
- most open source projects tend to use nant over msbuild, so there are plenty of build files and task you can make good use of or have as a reference.
- I have already played with nant a little, so I know it’s syntax better.
- I have started to use nant to automatically generate config files from templates for the different enviroments, and didn’t find the way to do so in msbuild.
- nant is open source, so people can contribute to it.
- nant is not tied to microsoft release cycle, msbuild is.

There isn’t any strong reason in itself to pick one, but adding them up, things favoured significantly nant over msbuild, so I ended up choosing the former.

If you want to read more on the subject, here are some of the links I used in my research (in no particular order):