NAnt, devenv.com and devenv.exe

In NAnt there is a solution task that works for VS.NET 2003, but not for VS.NET 2005. I needed to build a VS.NET 2005 solution from NAnt, so devenv.exe to the rescue: devenv.exe mysolution.sln /build Debug. Problem was that I did not get any output from the build process, not even if there were errors. A non 0 value was returned in case of errors, but I’m integrating with CruiseControl.Net (ccnet) and want my compilation output from the buildserver in case of errors. After some digging aand Googling I found the solution. Don’t use devenv.exe, but devenv.com and you get your output!!

Published Thursday, May 18, 2006 9:41 PM by svdoever
Filed under: ,

Comments

Thursday, May 18, 2006 7:17 PM by MonsoonDawn

# re: NAnt, devenv.com and devenv.exe

Use MSBuild instead. That's what devenv calls out to anyway.
Friday, May 19, 2006 7:18 AM by Michel grootjans

# re: NAnt, devenv.com and devenv.exe

Same thing here, I'd like to use NAnt to build a 2005 solution. Basically, with NAnt you can use csc, solution devenv or slingshot. All three have pros and contras. I prefer solution, because it integrates nicely with cc.net and is easy to configure. with csc, you have to provide the separate projects to build, the references, the output dirs...

JP Boodhoo (http://www.jpboodhoo.com/blog/) advocates csc in his examples.

I'm holding my breath for NAnt to support solution in 2005 ;-) NOT
Friday, May 19, 2006 10:34 AM by Serge van den Oever [Macaw]

# re: NAnt, devenv.com and devenv.exe

I'm sorry to say it, but for my goal, which is a completely scripted software development line with a lot of logic in it, msbuild is just not up to par to NAnt. Doing an exec on devenv.com works great for me, because I have a conditional flag for the postbuild steps in my solution so they will not be executed when my NAnt script is executed. But all projects etc. compile like a breeze with even the errors and warnings picked up corectly by ccnet.
Monday, May 29, 2006 4:01 PM by Dr.NETjes

# re: NAnt, devenv.com and devenv.exe

Serge, you should call MSBuild.exe from your NAnt script. Note that VS2005 also just calls MSBuild for compiling it's solution.
I used this NAnt/MSBuild combination for several months now without any problems. Besides, devenv should not never be installed on a CCNet server!

Example:
msbuild.exe [yoursolution].sln /p:Configuration=[Debug|Release]
Monday, May 29, 2006 4:08 PM by Dr.NETjes

# re: NAnt, devenv.com and devenv.exe

For >100 extra MSBuild tasks, please download Microsoft's free SDC tasks at:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=2cb20e79-d706-4706-9ea0-26188257ee7d

Tuesday, November 14, 2006 5:45 AM by Kazi

# re: NAnt, devenv.com and devenv.exe

Hi,

I am trying to run a vdproj setup project in Nant exec task to build a setup for deployment but it is giving me following error:

" [solution] Only C#, J#, VB.NET and C++ projects are supported.  Skipping projec

t 'D:\Mubashir\Projects\Net Projects\ITRS -- Senior Project\RA\RoyalSetup\RoyalS

etup.vdproj'."

My task in nant build file is as follows:

<exec failonerror="false" basedir="d:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE"

program="devenv.com" commandline="${solution.file} /build ${config} /project RoyalSetup /out ${build.log.dir}\Royalmsi.log" />

<fail if="${not file::exists(msi-file-name)}">The MSI failed to build. See log\msi.log for more details.</fail>

please help me out if you can as I have been trying to get this thing working for more than a day; but no results so far.

Friday, December 01, 2006 11:58 AM by Patrice Tremblay

# re: NAnt, devenv.com and devenv.exe

I totally agree with Dr.NETjes, but I'm sorry to say that the only simple way to automate the build of deployment projects (vdproj) is to use devenv from the nant script. MSBUILD doesn't support vdproj files (you get warnings) yet (will it ever?).

Tuesday, January 23, 2007 9:37 AM by Matt G

# re: NAnt, devenv.com and devenv.exe

Or, you can add the /out filename to the devenv.exe call, and filename will be your output file.

Wednesday, June 27, 2007 3:08 AM by Sudhi

# re: NAnt, devenv.com and devenv.exe

Hi,

Your suggestion with devenv.com helped me lot in automating nightly build.

Currently i am automating follwoing

1. Taking source from Visual Source Safe

2. Building the solution

3. Deploying the solution to "Emulator"

I am done with first two but not getting how to proceed with the third. Can u help me out in this? Is there any link i can get help on it? Since deployment to Emulator involves stuffs like connectting to device, selecting the emulator and deploying.

Wednesday, August 06, 2008 4:48 PM by Shane

# re: NAnt, devenv.com and devenv.exe

Kazi,

  Using the above <exec> command with the setup project name specified works great.  I have one issue that I am hoping is possible to resolve and that is... The Setup project that I am attempting to build using the command has spaces in the project name

"SpeechGear MS Word 2007Setup"  when I put this inside the commandline element it treats each space separated word as a separate project name.  I have tried alternate formats, see below, but the only means I have figured out to make this work is to rename the project.  Is there a different way to format the command line arguments in the quoted string so I can avoid renaming several projects?

Thanks,

Shane

commandline="Document.sln /Rebuild release /project ''SpeechGear MS Word 2007Setup'' /out .\07AddIn.log"

commandline="Document.sln /Rebuild release /project SpeechGear%20Document%20Add-in%20for%20MS%20Word%202007Setup /out .\07AddIn.log"

commandline="Document.sln /Rebuild release /project 'SpeechGearDocumentAdd-inforMSWord2007Setup' /out .\07AddIn.log"

commandline="Document.sln /Rebuild release /project \"SpeechGearDocumentAdd-inforMSWord2007Setup\" /out .\07AddIn.log"

Thursday, January 15, 2009 12:34 PM by Danny Graham

# re: NAnt, devenv.com and devenv.exe

Hi,

Your suggestion of devenv.com also helped me hugely for nightly builds.

MSBuild does not follow an identical building process to a build in the VS IDE. In particular it has real trouble compiling C++ projects that have references to C# projects. See here for more information: social.msdn.microsoft.com/.../f8f087fe-f820-490f-8872-5c8c5127ac46

However devenv.com got my around this and allowed me to set up a TeamCity automated build serve successfully.

Fantastic!

Thankyou

Thursday, April 09, 2009 3:07 AM by Philipp

# re: NAnt, devenv.com and devenv.exe

@Shane:

use <arg line="...."/>

instead of <commandline />

Leave a Comment

(required) 
(required) 
(optional)
(required)