Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Nant not working with TeamCity?

I have nant set up to build my ASP.NET MVC project and it works fine locally. I add nant to a tools folder and add it to version control. TeamCity picks up my changes and starts the build but it fails.

I believe I'm using the latest version of Nant and I have added the .net framework 3.5 to the nant.exe.config. What am I missing on the server and yes the .net framework is installed on the server as the asp.net mvc app does work if I manually build and deploy there?

The build file is as follows:

<target name="compile" description="Compiles using the AutomatedDebug Configuration">
    <msbuild project="Tolt.Sims.sln" />
</target>

Here is the error:

BUILD FAILED Failed to initialize the 'Microsoft .NET Framework 2.0' (net-2.0) target framework.
Property evaluation failed. Expression: ${path::combine(sdkInstallRoot, 'bin')} ^^^^^^^^^^^^^^ Property 'sdkInstallRoot' has not been set.
For more information regarding the cause of the build failure, run the build again in debug mode. Try 'nant -help' for more information
like image 469
Mike Roosa Avatar asked Oct 27 '08 18:10

Mike Roosa


1 Answers

If you're using the beta version of NAnt (which currently is the only way you'll get support for targeting anything greater than the 2.0 framework), you maybe running into a registry problem. A similar problem was reported by Tim Barcz.

Things pretty much boiled down to NAntContrib (provider of msbuild task) pointing to the 2.0 version of msbuild. Check out his solution to see if it applies to your scenario.

like image 160
Scott Saad Avatar answered Oct 01 '22 11:10

Scott Saad