NAnt 或 MSBuild,该选择哪一个?何时选择? [英] NAnt or MSBuild, which one to choose and when?

查看:27
本文介绍了NAnt 或 MSBuild,该选择哪一个?何时选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道还有其他 NAntMSBuild 上堆栈溢出的相关问题,但我找不到两者之间的直接比较,所以这里是问题.

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.

什么时候应该选择 NAnt 而不是 MSBuild?哪个更适合什么?NAnt 更适合家庭/开源项目,而 MSBuild 更适合工作项目吗?两者中的任何一个是什么体验?

When should one choose NAnt over MSBuild? Which one is better for what? Is NAnt more suitable for home/open source projects and MSBuild for work projects? What is the experience with any of the two?

推荐答案

我这周做了一个类似的调查.这是我能够确定的:

I've done a similar investigation this week. Here's what I've been able to determine:

南特:

  • 跨平台(支持 Linux/Mono).例如,将网站安装到多个目标(即 Linux Apache 和 Windows IIS)可能很方便.
  • 95% 的语法与 Ant 相似(对于当前的 Ant 用户或 Java 构建者来说很容易上手)
  • 与 NUnit 集成以在构建过程中运行单元测试,并与 NDoc 集成以生成文档.

MSBuild:

  • 内置于 .NET.
  • 与 Visual Studio 集成
  • 在 Visual Studio 中轻松开始使用 MSBuild - 这一切都在幕后.如果您想深入了解,可以手动编辑文件.

主观差异:(YMMV)

  • NAnt documentation is a little more straightforward. For example, the MSBuild Task Reference lists "Csc Task - Describes the Csc task and its parameters. " (thanks for the "help"?), vs the NAnt Task Reference "csc - Compiles C# programs." UPDATE: I've noticed the MSBuild documentation has been improved and is much better now (probably on par with NAnt).
  • Not easy to figure out how to edit the build script source (*.*proj file) directly from within Visual Studio. With NAnt I just have Visual Studio treat the .build script as an XML file.
  • Apparently, in Visual Studio, Web Application Projects don't get a *.*proj file by default, so I had great difficulty figuring out how to even get MSBuild to run on mine to create a deployment script.
  • NAnt is not built-in to Visual Studio and has to be added, either with an Add-In, or as an "External Tool". This is a bit of a pain to set up.
  • () One of my coworkers brought this up--if you want to set up a build machine using CruiseControl for continuous integration, CruiseControl integrates with NAnt nicely out of the box. UPDATE: CruiseControl also has an MSBuild task.
  • Please see comments below for full and up-to-date discussion of subjective differences.

这篇关于NAnt 或 MSBuild,该选择哪一个?何时选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆