Should I switch from nant to msbuild?

2019-01-22 02:13发布

I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out.

Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier?

Update: Any compelling features that would cause me to shift from nant to msbuild?

18条回答
Emotional °昔
2楼-- · 2019-01-22 02:43

I use MSBuild alongside Nant, because the current version of Nant can't as yet compile .NET 3.5 applications (same was true when .NET 2.0 first came out).

查看更多
我命由我不由天
3楼-- · 2019-01-22 02:45

We also switched from nant to msbuild. If Your build is pretty standard, then You won't have much problems setting it up, but if You have a lot of specific build tasks, You will have to write custom ms build tasks, as there are way less custom tasks for msbuild.

If you want to display reasonable build results, You will have to mess with custom loggers etc. The whole team build is not as ripe as nant is.

But the real benefit is integration with TFS source control and reporting services. If You are not using TFS as Your source control system, it's not worth it.

查看更多
叼着烟拽天下
4楼-- · 2019-01-22 02:48

I don't see any reason to switch. MsBuild itself locks you into the framework you are using. If you use NAnt, you can use it across many frameworks and shell out to msbuild to actually do the building task for you.

I am a fan of NAnt in this respect, because it decouples you from the framework a little bit.

I have created a framework that puts conventions into automated builds and I built it on NAnt. It's called UppercuT and it is the insanely easy to use Build Framework.

Automated Builds as easy as (1) solution name, (2) source control path, (3) company name for most projects!

http://code.google.com/p/uppercut/

Some good explanations here: UppercuT

查看更多
老娘就宠你
5楼-- · 2019-01-22 02:48

I switched from NANT to MSBuild. The project is running in .Net 4.0.

My experience in Nant was good. The project kind of died. And when .Net 4.0 came along, it was time to re evaluate the build process.

Since Nant was last released MSBuild has come along ways. At this point, MSBuild is the way to go. It's easy to use, has many extensions. I rewrote my Nant scripts in a day and a half. The MSBuild script is 1/3 the size of the Nant scripts.

Much of the work in the Nant script was setting up the different environments. In MsBuild/.Net 4.0 it's built-in.

查看更多
三岁会撩人
6楼-- · 2019-01-22 02:49

NAnt has been around longer, and is a considerably more mature product, and also IMO easier to use. There is a lot of community know-how out there to tap into, and it is also cross-platform, should you be interested in building apps that can run under Mono as well as .NET and Silverlight. Out of the box, it does a whole lot more than MSBuild does. Oh yes, and you can call MSBuild from NAnt (OK, from NAntContrib) :-)

On the negative side, NAnt and its sister project NAntContrib do seem to have stagnated, with the most recent update being late 2007.

The main advantages that I see of MSBuild is that it ships with the .NET Framework, so it's one less product to install; and there is more active development going on (albeit in places to catch up with the older NAnt).

Personally, I find its syntax a little more difficult to pick up, but then I'm sure continued exposure to ti would make things easier.

Conclusion? If you're working with existing NAnt scripts, stick with them, it's not worth the hassle of porting. If you're starting a new project, and you're feeling adventurous, then give MSBuild a go.

查看更多
We Are One
7楼-- · 2019-01-22 02:49

I use Nant and I love it. I used MSBuild and hated it because of these:

  1. Microsoft forces you to follow their own build procedure that is so intrinsic to their doings that I at least was not able to make it work (I had to compile NET1.1 so I had to mix Nant and MSbuild). I know you can create your own MSBuild file, but I thought it was complex to understand and maintain.

  2. ItemTypes to do file operations are just too hard to follow. You can have Nant do the exact same things and much easier and direct (I had to create an ItemType list and then pass to the file operations).

  3. In MsBuild you have to create your own task dll, in Nant you can do this or you can embed C# code within your script, so its much easier to advance and just build the whole project.

  4. Nant works with Net1.1, MsBuild doesn't.

  5. To install nant, I can even unzip and locate inside my own repository to run it. To install MsBuild is much harder since it depends on many things from Visual Studio, etc. (maybe I'm wrong here, but that seems to be the truth).

Well these are my opinions...

查看更多
登录 后发表回答