0
votes

I noticed that projects that were originally created in VS 2008 do not compile using the nantcontrib msbuild task. There is a solution that I've seen here but it seems like a bit of a hack, considering 'MSBuildBinPath' has been depricated, and I don't exactly like the idea of changing this property on every single project file that I create in VS 2008.

Short of changing build scripts to call msbuild through an exec task, is there any way to point the msbuild task at a particular version of MSBuild? Perhaps this is in the works for the next release of Nant?

2

2 Answers

3
votes

There is another option, calling MsBuild.exe directly.

Here's an example:

<property name="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"/>    
    <target name="build">
        <exec program="${MSBuildPath}">
            <arg line='"${SolutionFile}"' />
            <arg line="/property:Configuration=${SolutionConfiguration}" />
            <arg value="/target:Rebuild" />
            <arg value="/verbosity:normal" />
            <arg value="/nologo" />
        </exec>
    </target>

If you're calling Nant from Cruise Control .NET, you can also add this argument:

<arg line='/logger:"C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"'/>