使用 MSBuild/Nant 与 Visual Studio 2005/2008 的开发经验

发布于 2024-07-20 06:42:34 字数 347 浏览 8 评论 0原文

我与其他 4 名开发人员一起开发一个项目。 我们目前使用 Visual Studio 通过一些构建前和构建后事件来构建我们的解决方案。

我想转向更强大的构建系统,例如 Nant 或 MsBuild。

这两种方法的优缺点是什么?

开发人员使用 Nant/MsBuild 的体验如何? 按F5 可以轻松调试应用程序吗? 解决方案资源管理器中是否还有不错的文件列表? 或者每次需要向项目添加 .cs 文件时是否都需要进入 XML 文件?

这一切如何与源代码控制集成? (我目前正在使用 SourceGear Vault。)

我正在尝试收集足够的信息,以便做出明智的决定。

I work on a project with 4 other devs. We currently use Visual Studio to build our solution with some Pre and Post build events.

I would like to move to a more powerful build system such as Nant or MsBuild.

What are the pros and cons of the two approaches?

How is the developer experience using Nant/MsBuild? Is it easy to debug the application by pressing F5? Is there still a nice list of files in the solution explorer? Or do I need to get into an XML file every time I need to add a .cs file to my project?

How does this all integrate with Source Control? (I'm currently using SourceGear Vault.)

I'm trying to gather enough information so that I can make an informed decision.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

放低过去 2024-07-27 06:42:34

有一点需要注意。 如果您使用的是 VS2005 或更高版本(C++ 除外),则您已经在使用 MsBuild。 .csproj 和 .vbproj 文件实际上是底层的 MsBuild 文件。 VS 托管 MsBuild 以进行构建。

不过,我无法提供关于南特的太多/任何反馈。

One thing to note. If you're using VS2005 or later, with the exception of C++, you're already using MsBuild. The .csproj and .vbproj files are actually MsBuild files under the hood. VS hosts MsBuild in order to do a build.

I can't provide much / any feedback about Nant though.

乖不如嘢 2024-07-27 06:42:34

我将 nant 用于我的构建脚本,发现它可靠并且得到良好的支持。 在这一点上,msbuild 和 nant 在很多方面看起来都是平等的。 Msbuild 有一些优点,因为它由 Visual Studio 使用,因此它是平台的内置部分。 然而,nant 拥有很多功能、附加任务和一个大型社区,因为它已经存在了很长时间。

Nant 拥有适用于大多数源代码控制提供程序的插件 - 包括 Vault< /a> - 并且具有大多数构建工具(例如 CruiseControl.NET 和 TeamCity)的挂钩。

开发人员体验与仅按 F5 略有不同。 一般来说,nant 或 msbuild 文件包含许多在正常快速编译过程中通常不会运行的功能。 这些脚本用于运行测试、运行构建工具(例如 FxCop 或 StyleCop)、更新/提交工作副本、标记源代码、创建/更新/填充数据库以及构建安装程序或包。 并非所有这些事情都会在每次编译时完成。 这是构建脚本工具提供最大好处的地方,并且是在 Visual Studio 的权限之外完成的。

我想你会对其中任何一个感到满意。 如果您主要使用 MS 工具,则 msbuild 可能会更加无缝。 另一方面,如果您使用许多经常使用 nant 的开源工具,nant 可能是一个不错的选择。

I use nant for my build scripts and find it reliable and well supported. At this point, msbuild and nant seem even in a lot of respects. Msbuild has some advantages in that is it is used by Visual Studio, so it is a built-in part of the platform. However, nant has a lot of functionality, add-in tasks and a large community, since it has been around longer.

Nant has plug-ins for most all source code control providers - including Vault - and has hooks for most build tools such as CruiseControl.NET and TeamCity.

The developer experience is a little different than just pressing F5. Generally, the nant or msbuild files encompass a lot of functionality you normally wouldn't run during the normal, quick compilation. The scripts are used to run tests, run build tools (such as FxCop or StyleCop), update/commit working copies, tag source code, create/update/populate databases and building installers or packages. Not all of these things are done at every compile. This is where build scripting tools provide the most benefit and are done outside the purview of Visual Studio.

I think you will be happy with either one. If you are using mostly MS tools, msbuild may be more seamless. On the other hand, nant may be a good choice if you are using many open source tools, which often use nant.

携君以终年 2024-07-27 06:42:34

背景:我使用 Ant 做了很多工作,在此之前和之后使用 make 做了更多的工作(在非常大的系统上 - 想象一下数百万行代码的数万行 makefile) ,并且倾向于定期破解专门的构建系统。 而且,哦,是的,我讨厌大多数 MS 工具。

我不推荐 Ant 类型的构建系统。 这么说让我很痛苦,但你最好坚持使用 Visual Studio。 Nant 会带走你习惯的很多简洁的 GUI 类型的东西,而且它不太可能给你带来太多回报。

问题的很大一部分,可能是大部分,是该死的 XML 东西。 (好吧,它甚至不是真正的 XML;尝试为 Ant 构建脚本编写 DTD。)James Duncan Davidson(Ant 的创始人)有 多次声明使用 Ant 的 XML 是一个错误,而 Ken Arnold 在与 Ducan Davidson 的讨论中似乎说出 Ducan Davidson 有点害羞而不敢说的话。

阿诺德(Arnold)解释了詹姆斯·高斯林(James Gosling)的话:“每个配置文件都成为一种编程语言,所以你不妨这样想。”

我完全理解你现在的“编程语言”非常非常差,就在 VS 下构建你的项目而言,我很高兴并且印象深刻的是你想要解决这个问题。 不幸的是,南特不会帮助你走这条路。

Background: I've done a lot of work with Ant, much more work with make before and after that (on very large systems—think tens of thousands of lines of makefiles for millions of lines of code), and tend to hack out specialized build systems on a regular basis. And, oh yeah, I hate most MS tools.

I can't recommend Ant-type build systems. It pains me to say so, but you are probably better off sticking with Visual Studio. Nant will take away a lot of the neat GUI-type stuff you're used to, and it's not likely to give you much in return.

A big part of the problem, probably the majority of it, is that damn XML thing. (Well, it's not even really XML; try to write a DTD for an Ant build script.) James Duncan Davidson (the originator of Ant) has stated several times that using XML for Ant was a mistake, and Ken Arnold, in his discussions with Ducan Davidson, appears to be saying what Ducan Davidson is a little bit too shy to say.

Arnold paraphrases James Gosling: "Every configuration file becomes a programming language, so you might as well think that way."

I entirely understand that you have a very, very poor "programming language" now, as far as building your projects under VS goes, and I'm happy and impressed that you want to fix that. Unfortunately, Nant is not going to help you down that road.

◇流星雨 2024-07-27 06:42:34

使用 CruiseControl.NET 来自动化您的构建过程。MSBuild 比 NANT 更容易连接,MSBuild 可以在 .NET Framework 文件夹中找到。SGear 有用于 CruiseControl.NET 的插件,您可以为 MSBuild 编写和下载任务插件... 。

Use CruiseControl.NET to automate your build process.MSBuild is easier to hook up than NANT,MSBuild is found in .NET Framework folder.SGear has plugins for CruiseControl.NET,there are task plugins you can write and download for MSBuild....

故事还在继续 2024-07-27 06:42:34

我曾经使用 Nant,最近我开始使用 MSBuild。

和您一样,我也是 Vault Sourcegear 用户,您会发现 Vault 没有 MSBuild 任务...或者有吗?

我拥有一些与 Vault 一起使用的 MSBuild 任务的源代码。 它们工作得很好,并且基于 NANT 任务的移植(我不太清楚具体的时间/日期)。

我从一个完成了移植并打算在 SourceForge/CodePlex 或其他类似平台上开源它们的人那里得到了它们。 但可惜他结婚了,然后就无暇顾及了。

我向他请求代码,他通过电子邮件将其发送给我……从那时起,我就一直坐在代码上,没有空闲时间,也没有意愿费心将它们归还给它们会受到喜爱的公共领域。

如果有人对他们感兴趣,我很高兴看到他们去了一个更好的家

:p

http ==> img269.imageshack.us/img269/4467/msbuildsourcegearvaultt.png

I used to use Nant, more recently I've taken to using MSBuild.

Like you I'm a Vault Sourcegear users as well and as you'll have discovered there are no MSBuild tasks for Vault .... or are there?

I have the source code in my possession for some MSBuild tasks for using with Vault. They work quite well and are based on a port from the NANT tasks (at which point/date I don't exactly know).

They came into my possession from a guy who had done the porting and was intending to open source them on SourceForge/CodePlex or some such. But alas he got married and then couldn't be bothered.

I begged him for the code and he emailed it to me ... I have since sat on the code without the spare time or inclination to have bothered to return them to the public domain where they would be loved.

If anyone's interested in them I'm quite happy to see them go to a better home

:p

http ==> img269.imageshack.us/img269/4467/msbuildsourcegearvaultt.png

尛丟丟 2024-07-27 06:42:34

在 Nant vs MsBuild 这里

Found a useful thread on Nant vs MsBuild here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文