NAnt or MSBuild, which one to choose and when?

前端 未结 14 765
你的背包
你的背包 2020-11-27 09:15

I am aware there are other NAnt and MSBuild related questions on Stack Overflow, but I could not find a direct comparison between the two and so here is the question.

14条回答
  •  情深已故
    2020-11-27 09:37

    Personally, I use both - for the same project.

    MSBuild is great at building Visual Studio solutions and projects - that's what it's made for.

    NAnt is more easily hand-editable, in my opinion - particularly if you already know Ant. NAnt can call MSBuild very easily with NAntContrib. So, I hand-craft a NAnt script to do things like copying built files, cleaning up etc - and call MSBuild to do the actual "turn my C# source code into assemblies" part.

    If you want an example of that, look at my Protocol Buffers build file. (I wouldn't claim it's a fabulous NAnt script, but it does the job.)

提交回复
热议问题