Problem
The .NET Framework reference in the most recent release of Tree Surgeon has an old reference to .NET 2.0 Beta 1. This is in the NAnt.exe.config file.
This will produce results that will not compile when using the <msbuild> task of the NAntContrib Tasks.
Fix
Open the file located in “ProjectName/Tools/nant/NAnt.exe.config” file.
Find this:
<framework
name=“net-2.0”
family=“net”
version=“2.0”
description=“Microsoft .NET Framework 2.0 Beta 1”
runtimeengine=“”
sdkdirectory=“${path::combine(sdkInstallRoot, ‘bin’)}”
frameworkdirectory=“${path::combine(installRoot, ‘v2.0.40607’)}”
frameworkassemblydirectory=“${path::combine(installRoot, ‘v2.0.40607’)}”
clrversion=“2.0.40607”
>
Then replace it with this:
<framework
name=“net-2.0”
family=“net”
version=“2.0”
description=“Microsoft .NET Framework 2.0”
runtimeengine=“”
sdkdirectory=“${path::combine(sdkInstallRoot, ‘bin’)}”
frameworkdirectory=“${path::combine(installRoot, ‘v2.0.50727’)}”
frameworkassemblydirectory=“${path::combine(installRoot, ‘v2.0.50727’)}”
clrversion=“2.0.50727”
>
This will fix the issue and allow you to remove the <solution> task from the default build file that is included in each project generation.
You will now be able to utilize the <msbuild> task in the NAntContrib. See below:
<target name=“compile” description=“Compiles using the AutomatedDebug Configuration”>
<loadtasks assembly=“tools/nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll” />
<msbuild project=“src\MyProject.sln”>
<property name=“Configuration” value=“AutomatedDebug” />
</msbuild>
</target>
Leave a Reply
You must be logged in to post a comment.