Nant, MSBuild, and .NET 3.5 Oh My!

So just a quickie post. NAnt doesn't play very nicely with the MSBuild task especially with .NET 3.5, so I thought I'd post a snippet from a build file that I think I finally like (and works!).

* project has been renamed [to csharptocsharp] to protect the innocent lame!

<property name="msbuild" value="C:/WINDOWS/Microsoft.NET/Framework/v3.5/MSBuild.exe" />
<target name="compile" description="Compiles using the AutomatedDebug Configuration">
<!-- NAnt doesn't like this part! :( -->
<!--<msbuild project="src\csharptocsharp.com.sln">
<property name="Configuration" value="AutomatedDebug" />
</msbuild>-->
<!-- So we just use an exec task instead!-->
<exec program="${msbuild}">
<arg value="src\csharptocsharp.com.sln" />
<arg value="/v:n" />
<arg value="/p:Configuration=AutomatedDebug" />
<arg value="/p:WarningLevel=0" />
</exec>
</target>

kick it on DotNetKicks.com

About Brian


Brian Canzanella brings you nifty tips and tricks for most things .NET. read more...

Readers / Stuff