Building .NET projects: NANT vs. MSBuild

Nov 09, 2011

So for .NET projects, we should be using NAnt and/or msbuild or a combination of them.   Cesar Intriago will write something more comprehensive on this at a later date, but here are some links to discussions on the tradeoffs of each.  Also, I've attached the build.xml file from Scripps to give everyone a starting point when you are building a .NET project

.

http://www.codinginstinct.com/2008/04/msbuild-vs-nant-some-good-and-some-bad.html
http://www.dotnetjunkies.com/WebLog/netblog/archive/2006/11/12/Crossroads_NAnt_vs_MSBuild.aspx
http://www.winterdom.com/weblog/2007/09/21/MSBuildVsNAnt.aspx
http://forums.msdn.microsoft.com/en-US/msbuild/thread/994761a3-ea9d-40c7-8d4f-4c208b2023f6/
http://www.paraesthesia.com/archive/2008/01/08/why-nant-is-better-than-msbuild.aspx
http://www.ayende.com/Blog/archive/2008/02/24/MsBuild-vs.-NAnt.aspx


The general consensus here is that no one except the Microsoft employees that work on their <build/> team like msbuild, but there are certain things that can ONLY be done in MSBuild.


The most obvious thing I've seen is that NAnt's <csc> task can't compile classes that where the imports are predefined for the project (i.e. allowing developers to be lazy and not have to have "using Scripps.Website..." statements at the top of all their classes). 


Maybe I need to be more progressive about the need for importing packages/namespaces.  I suppose with Intellisense (as long as you are viewing the class within your IDE), you don't need the import/using statements at the top to let you know where classes are located.  And with the advent of the IDE dropping the import/using statement automatically for you, maybe importing packages/namespaces will become a thing of the past...