views:

3649

answers:

7

I'm trying to get NAnt 0.86b1 running with VS2008 SP1 and x64 XP.

I have a basic build file (below) which gives the error Solution format of file 'Solution.sln' is not supported.

<property name="nant.settings.currentframework" value="net-3.5" />

<target name="build" description="Full Rebuild" depends="clean,compile" /> 

<target name="clean" description="Cleans outputs">
 <delete dir="bin" failonerror="false" />
 <delete dir="obj" failonerror="false" />
</target>

<target name="compile" description="Compiles solution">
 <solution configuration="debug" solutionfile="Solution.sln" />
</target>

Has anyone else experienced this problem? I can't find anything useful out there about this.

A: 

Check this article:

Upgrade NAnt for use with VS2008 solutions and .Net 3.5

CMS
+7  A: 

You'll notice that the docs indicate that NAnt's <solution> task doesn't support solution files newer than VS2003.

I recommend using the <msbuild> task from nantcontrib for all projects newer than VS2003.

Also, the .85 version of NAnt only supports framework versions up to 2.0. The purest way to get things working against the 3.5 framework is to use the .86-beta1 versions of NAnt. You'll then be able to use the <msbuild> task against the 3.5 solution.

Matt Campbell
A: 

CMS, there is already a 3.5 section there. Should it be replaced with that in the linked blog post?

Or do I need to use Matt's suggestion?

framework name="net-3.5" family="net" version="2.0" description="Microsoft .NET Framework 3.5" sdkdirectory="${path::combine(sdkInstallRoot, 'bin')}" frameworkdirectory="${path::combine(installRoot, 'v3.5')}" frameworkassemblydirectory="${path::combine(installRoot, 'v2.0.50727')}" clrversion="2.0.50727" > . . .

Mr. Flibble
A: 

I am using nant-0.86-beta1 but still getting the same error Solution format of file 'C:**\Platform.sln' is not supported.Nested build failed. Refer to build log for exact reason.

Any other suggestion to work it out.

NaV
+6  A: 

nant-0.86-beta1 supports 3.5 but not in the solution node how nice. I ended up using this from the nantcontrib:

  <target name="build" description="Compiles using the AutomatedDebug Configuration">
    <!-- <loadtasks assembly="C:\Dev\nant-0.86-beta1\bin\NAnt.Contrib.Tasks.dll"  /> -->
    <msbuild project="${Solution.Filename}">
      <property name="Configuration" value="Release"/>
    </msbuild>
  </target>
+1 for using the msbuild tasks. I've been playing with both since I'm starting to automate our builds and the msbuild is just quicker to get up and running. I also think the idea of using the actual solution/project files to run the build is just a 'good idea' as it means all the build info is in one place. (Rather than have a solution/project for VS and a Nant configuration.)
Peter Bernier
+2  A: 

See Building the platform code with nant and VS2008

This is here on Stack overflow. Basically you only have a couple of options, control all the builds yourself with project build files, common build files, and a master build file. Or run the Exec task to exectue the correct version of MSBuild for each solution you want compiled.

Joshua Cauble
A: 

Huh, this error makes be feel dumb :-\

BUILD FAILED

Solution format of file 'C:\cruiseprojects\projects\f09_sdp_camd\work\CruiseControlDir\WinForms.sln' is not supported.

Total time: 0.1 seconds.

rajat