views:

31

answers:

2

I have two different version of the Visual Studio IDE on a build machine. My question is how do I know which version of the compiler NAnt is using? Is there a way to direct NAnt to use a specific version?

+1  A: 

You can point which .NET Framework running nant with -t:net-3.5 parameter, this example will use .NET 3.5. You may also point directly in nant script which msbuild version he need to use to compile project.

<property name="MSBuildApp" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe" />
<exec failonerror="true" program="${MSBuildApp}" verbose="true">
        <arg value="${SlnDir}\${SlnFile}" />
        <arg value="/t:Rebuild" />
        <arg value="/p:Configuration=${SlnConfig}" />
    </exec>
Leszek Wachowicz
A: 

This is very similar to another question I answered a while back, check out this question: http://stackoverflow.com/questions/1195389/msbuild-task-or-msbuild-exe-with-nant/1202121

Babak Naffas