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 (alt.alt.net :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):
http://ayende.com/Blog/archive/2008/02/25/Zero-Friction-and-why-Defaults-Matters.aspx
http://www.winterdom.com/weblog/2007/09/21/MSBuildVsNAnt.aspx
http://www.paraesthesia.com/archive/2008/01/08/why-nant-is-better-than-msbuild.aspx
http://www.innoq.com/blog/hw/2007/09/24/msbuild_vs_nant.html
http://www.codeproject.com/KB/books/msbuild.aspx
http://brandonbyars.com/blog/articles/2008/01/10/Managing-Config-Files
http://www.paraesthesia.com/archive/2008/01/08/why-nant-is-better-than-msbuild.aspx
http://kentb.blogspot.com/2008/02/fail-early-with-full-builds-from-within.html
http://weblogs.asp.net/rosherove/archive/2008/01/18/trying-out-team-city-looks-promising.aspx
http://codebetter.com/blogs/jeremy.miller/archive/2007/09/20/is-there-a-good-reason-to-switch-to-msbuild.aspx
http://codebetter.com/blogs/jeffrey.palermo/archive/2007/09/25/demo-on-automating-your-build-with-nant-and-ccnet.aspx
http://www.distribucon.com/blog/WhyMSBuildSucks.aspx
http://www.tkachenko.com/blog/archives/000643.html

Comments