views:

438

answers:

3

Hi guys,

I'm just trying to get into NAnt for my build processes, and successfully have a script that sets up a build dir, and compiles a sln file into it. My question now is, on a day to day basis how would you execute the NAnt script from Visual Studio. I'm used to just hitting Ctrl + Shift + B and then just refreshing my browser (I have a local site setup pointing to the project folder), but whats the best way to intergrate the NAnt script with VS?

Many thanks

Matt

+1  A: 

You'll find a description of how to do this here.

David M
+1  A: 

Depends what you want to do with it.

You can add it as a post/pre build event, if that's your thing (I do that for some things), but mostly I use NAnt to build on the buildserver, so it doesn't serve much purpose on the local machine.

Noon Silk
Bit of a sweeping statement - you don't know what pre-build tasks might be included in the NAnt script. Some can certainly serve a purpose on the local machine. I agree that many don't though...
David M
Oh agreed; and I'd upvote your post if I could (I've hit the limit of votes today), because I didn't quite realise you could replace the default Ctrl-Shift-B like that. Nevertheless, I think pre/post is where I'd be adding NAnt (and, in fact, it's where I *do* add it :) and let MSBuild do the work locally; it's perfect.
Noon Silk
So would you both say that an NAnt script is better suited to the build server and stick with MSBuild localy? The only thing I can see needing it to replace in my current setup is that of merging config files.
Matt Brailsford
Yes, I was NAnt for a bit of config-file work locally as well. Anyway, even on the buildserver we use NAnt to *call* MSBuild, so certainly I'd stick with MSBuild locally, and use NAnt in the pre/post for some misc work like configs.
Noon Silk
+1  A: 

Here's a more complete solution to the problem:

http://broloco.blogspot.com/2008/03/using-nant-with-visual-studio.html

S

Steve