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!!

8 Comments

  • Use MSBuild instead. That's what devenv calls out to anyway.

  • 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]

  • 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:


    The MSI failed to build. See log\msi.log for more details.

    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.

  • 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?).

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

  • @Shane:

    use
    instead of

  • Although MSBuild is a viable option if you only have a single version of Visual Studio, it doesn't work when you have multiple versions. I have VS2005, VS2008 and VS2010. Depending on what project I am building I want to run the devenv.com in the appropriate Program Files folder. If someone knows how to do this with MSBuild I'd love to hear it. However, doing what I need with and using a path that points to the correct devenv.com works fine.

    On a different note, I cannot get an of devenv.com or devenv.exe to work under Windows 7 on some machines. I have this working fine on one machine with Win 7 Ultimate, yet on another one it fails with the message that the command needs to be elevated. I cannot see any way to elevate a NAnt exec call to Admin. Anyone have any ideas?

  • автор можно узнать вас ICQ для обмена постовыми

Comments have been disabled for this content.