MSBuild vs. NAnt

Correct me if I'm wrong but isn't MSBuild a knock off of NAnt or any other derivative of Ant?

Is the only reason MS created such a build tool is so that internal MS employees could use it? Do their employee contracts prohibit them from using Open Source tools? That's my speculation. Please correct me if I'm wrong.

It's not a problem if I'm right - but why not just use it internally at MS? Why make it public for everybody's use. We already have a decent tool and we get the source code to boot - not to mention community support.

I didn't get a chance to go to the MS Build presentation (TLS347) so I apologize in advance if I'm just not getting it. I have looked at the slides but there isn't much there - nothing that I don't see in NAnt.

I'm really looking for the killer reason not to use NAnt and switch to MSBuild. Maybe the answer is this..

MSBuild will be the core build engine underneath Visual Studio and share project file formats with VS.NET. Certainly this has caused me some grief with NAnt in the past, mostly with VB.NET since slingshot (the last time I looked) only converted csproj files to build files and not vbproj. So I think the most important thing about MSBuild is not MSBuild itself but that the C# and VB.NET teams will have to (or already have) collaborated on a unified .proj file format. Hopefully the NAnt contributors will write an XslTransform. As an aside I hear that this level of integration won't be available for C++ developers. Now getting three teams to talk to each other - that's just impossible. I bet that the .proj file format changes again when the C++ team gets around to supporting MSBuild.

In addition to the VS.NET integration, there seems to be only 1 other significant difference between NAnt and MSBuild. MSBuild includes some kind of “full inner-task dependency“ that is supposed to allow for incremental builds. While I might care about this for an IDE experience (slightly) it's less important from a nightly build scenario - IMHO.

Comments

  • Barry Gervin December 29, 2003 4:47 PM

    Hi Barry,
    One additional major benefit is that MSBuild will ship with the Framework and eventually with the OS. This means tool vendors, MSBuild task writers and the community in general will have a great bare-bones (but highly extensible) development platform already on the box.

    Also, this means your buddy can send you a zipped-up VS .NET C#, VB or J# project and you can build it on your system without having VS installed.

    Have a great New Year!

    Jomo Fisher
    Developer
    MSBuild Team, Microsoft

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Barry Gervin January 28, 2004 9:34 AM

    First of all I feel sorry for the Nant team, having done a great job for no pay. However I am glad with the promise to have a seamlessly with VS.NET integrated build tool! Further, I expect the userbase for a microsoft product to become way bigger than the Nant userbase. This means a higher percentage of questions, tricks, problems already answered at forums. My experience searching for searching for answers in the history of the nant-users base is moderate negative. However when I'm looking for answers at microsoft forums for .NET related stuff, 9 out of 10 times I find it and don't have to ask the question and wait for an answer. Further lack of support for globalization, having a double build proces, and having to do countless workarounds for bugs in Nant frustrated me often.

  • Barry Gervin August 3, 2004 11:46 PM

    In answer to the question, no, it is not the case that MS employees are prohibited from using open source tools.

  • Barry Gervin July 28, 2005 4:50 PM

    Nant has much more task than the msbuild.
    source safe support, etc

  • Barry Gervin August 14, 2005 11:36 PM

    I agree with barak, although i've just read the MSBuild reference and not used it, NAnt has a lot more going for it, it's a real pity that Microsoft couldn't use/improve NAnt instead of subverting (well...ripping it off!) it and making their own. Do Microsoft really hate/fear open source that much?

    Henk, i've found NAnt support to be really good, Gert, Ian et al. are very helpful, the documentation is good, and reading the source code helps too :)

    I have NAnt running the same scripts on Mono on Linux and Windows as on .NET on Windows. It's a really nice, flexible, versatile tool, much more than a build tool.

  • Barry Gervin September 19, 2005 8:07 AM

    i want to know whether NAnt is an integrated build tool?

  • Barry Gervin November 21, 2005 12:14 AM

    Sometimes using open-source software like NANT is against your personal lazyness. You should adjust yourself.

    I still use NANT.

    What do you mean by integrated? I just leave the VS IDE to use NANT. I found it few differences if I used MSBuild. Just more "Alt+Tab"s.

  • Barry Gervin December 5, 2005 3:38 AM

    I have read all the comments by various CM practionares above. But still I am not sure which side is heavier in terms of Maturity, Stability, Flexibility and Useability etc. If anyone do have some comparitive analysis conducted by someone authentic then I certainly would like to have it.

    Till now I have used both the tools for R&D purpose and my personal opinion is that for the timebeing NAnt is comparitive better tool to use in terms of aspects indicated above by me but later I am sure Microsoft will rethink about their strategy of developing build tool on such aspects.

  • Barry Gervin January 30, 2006 3:05 PM

    Sorry to burst everyone's bubble but msbuild is lacking many of the features that NAnt already provides. targets in msbuild are not same construct as they are in nant. doing mundane things like a for loop in a for loop is impossible with msbuild. inline c# code is not supported either. nant still has its place and if MS wants to replace it they'll have to try a lot harder ;)

  • Barry Gervin March 31, 2006 1:47 PM

    Hmm. Are those of you that are using NAnt using it with the latest version of the .Net Framework (2.0) I am finding that the latest updates to NAnt, Draco.Net and related tools are pre-2.0. Where can I find help for specific 2.0 integration for these tools? Thanks.

  • Barry Gervin May 16, 2006 4:47 AM

    Thats correct Scott. I have been trying to integrate CruiseControl.Net(Continuous Integration) with NANT. And unfortunately I found that NANT supports untill the .NET Framework 2.0 Beta. And I found it yesterday evening while streamlining the project for the test build.

    So, I think there are two approaches. (1) Instead of using NANT incojuction with CCNET, I would use MSBuild. (2) NANT would be used as primary build tool inconjuction with CCNET. And NANT would give call to the MSBuild.

    Hey, buddies please help me to take the decision. (hardikt@kpitcummins.com)

  • Barry Gervin June 5, 2006 4:49 PM

    As you somewhat stated a good reason to use MSBuild is because the .proj file that is generated by Visual Studio is an MSBuild file. So you don't have to be relient on external build files to be present to build your product.
    Another good reason is that you can re-produce the same build that Visual Studio produces. With external tools this is not the case.
    About your comment "Now getting three teams to talk to each other - that's just impossible.": MSBuild is building C#, VB.NET & J# projects. Also there is now a Web Deployment project that uses MSBuild. Along with this there is another product for game development XNA™ Build which is built on top of MSBuild.
    I think that NANT is a great tool and I imagine that many teams will use both tools concurrently.

  • Barry Gervin June 8, 2006 5:19 AM

    We decided to follow the Nant route but also to use msbuild.
    We are using VS2005 which the current Nant solution task does not support.
    So we wrote a very simple task to call msbuild. Best of both worlds :-)

  • Barry Gervin June 8, 2006 9:59 AM

    I trigger msbuild from nant ;) .... when i want to build m$ projects

  • Barry Gervin August 10, 2006 2:53 PM

    I think it's a great shame Microsoft didn't build on NANT and chose to reinvent the wheel, ending up with a stoneage cart-wheel instead of a more modern, pneumatic ABS one.

    At my company have a large build system and make NANT do all kinds of things apart from building code - like building the database, loading unit test data, interacting with source control, and running code snippets. I appreciate the extensibility model in MSBUILD, but because of our existing investment in NANT, we cannot adopt MSBUILD as our primary build tool now, but will have to painfully migrate to it over time. In it's current incarnation, it's just too little, too late. I will be looking for an XSL so our NANT build continues to work (we had a lot of success with a customized XSL in the past). Failing that, we will launch MSBUILD from NANT to get compilation to work. Also will need to get CruiseControl working with the new output.

  • Barry Gervin October 26, 2006 6:48 AM

    The cynic in me says that Microsoft chose to develop MSBuild instead of NAnt, because NAnt is licensed using the GPL, and Microsoft will not have anything to do with GPL-licensed software.

  • Aaron January 29, 2007 5:39 AM

    Yeah seriously, sometimes MS just tries to piss developers off.  Its too bad they dont want to foster an open source community like the Java world has.  Thats a big plus to their side.  The .NET world is very centered on MS and the way they do things, which can suck when the MS way is tarded.

New Comments to this post are disabled