与从命令行运行 DevEnv.exe 相比,使用 MSBuild 或 NAnt 的优势 [英] Advantages of using MSBuild or NAnt versus running DevEnv.exe from command-line

查看:16
本文介绍了与从命令行运行 DevEnv.exe 相比,使用 MSBuild 或 NAnt 的优势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能解释一下使用像 MSBuild(或 NAnt)这样的工具来构建项目集合与从命令行运行 DevEnv.exe 相比有什么优势?

Can anyone explain what advantages there are to using a tool like MSBuild (or NAnt) to build a collection of projects versus running DevEnv.exe from the command-line?

我以前共事过的一位同事解释说(至少在旧版本的 Visual Studio 中)使用 DevEnv.exe 比其他技术慢得多,但我没有读到任何证据,或者如果那现在是一个有争议的问题,从 2005 年开始,Visual Studio 在后台使用 MSBuild.

A colleague I had worked with in the past had explained that (at least with older versions of Visual Studio) using DevEnv.exe was much slower than the other techniques, but I haven't read any evidence of that or if that is now a moot point now that starting with 2005, Visual Studio uses MSBuild under the hood.

我知道使用 MSBuild 的一个优势是您可以构建项目,而无需在构建机器上安装 Visual Studio,但我不确定是否还有其他优势.

I know one advantage of using MSBuild allows you to build your projects without requiring Visual Studio to be installed on the build machines, but I wasn't sure if there were others.

推荐答案

一个原因是因为构建产品不仅仅是编译它.由于这些工具(及其扩展)提供的功能,创建安装、更新版本号、创建托管、分发最终包等任务会变得更加容易.

One reason is because there's much more to building a product than just compiling it. Tasks such as creating installs, updating version numbers, creating escrows, distributing the final packages, etc. can be much easier because of what these tools (and their extensions) provide.

虽然您可以使用常规脚本完成所有这些工作,但使用 NAnt 或 MSBuild 为您提供了一个可靠的框架来完成所有这些工作.两者都有很多社区支持,包括可以下载的其他任务(例如 MSBuild 社区任务项目).此外,许多第三方和开源产品都支持它们.

While you could do all this with regular scripts, using NAnt or MSBuild give you a solid framework for doing all this. There's a lot of community support for both, including additional tasks that can be downloaded (such as the MSBuild Community Tasks Project). Plus, there's support for them in numerous third party and open source products.

如果您只对编译感兴趣(而不是整个构建过程),您可能会发现 MSBuild 的一个节省时间的好处是 支持多处理器构建.

If you're just interested in compiling (and not the entire build process), you may find one time saving benefit of MSBuild is the support for building with multiple processors.

这篇关于与从命令行运行 DevEnv.exe 相比,使用 MSBuild 或 NAnt 的优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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