views:

466

answers:

2

I'm configuring a CruiseControl.net server for the first time. My team already uses NAnt build scripts, so we are just pointing the server at the scripts and letting NAnt do all the work.

As you can see, it's pretty simple:

<project name="ChannelIP">
 <tasks>
  <nant>
   <executable>C:\Program Files\nant-0.86-beta1\bin\nant.exe</executable>
   <baseDirectory>D:\mypath</baseDirectory>
   <buildFile>D:\mypath\myNAnt.build</buildFile>
   <targetList>
    <target>build</target>
   </targetList>
  </nant>
 </tasks>
</project>

The problem is that when I run it under CC, I get the following error:

Function call failed. Expression: ${framework::get-framework-directory('net-3.5')}/msbuild.exe

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Microsoft .NET Framework 3.5 (net-3.5) is not installed, or not correctly configured. Object reference not set to an instance of an object.

I do, in fact, use the ${framework::get-framework-directory('net-3.5')} variable to get the path to msbuild.exe; however, this code has never failed before. I can even RDP into the server using the user account that CC is running under and run the NAnt build file directly and it works just fine.

Why is it that this otherwise fine file fails just when CC runs it.

NOTE -CC is running on the same machine that I normally run the build scripts from

+2  A: 

The CC service is probably not running under an account with appropriate permissions. Have you tried running CC using the command line (which will run as the logged on user) to see if you have the same problem?

jellomonkey
Good suggestion, Actually that was something I had a problem with earlier, but had found and fixed. Thanks for the thought though.
Michael La Voie
+1  A: 

This sounds like a NAnt problem, there were some issues with it and .NET 3.5. Which version of NAnt are you using?

Also, have you seen Using 0.86 beta 1 for .NET 3.5? The guy has the same error message thrown by NAnt. The suggested solution was to use the latest nightly build.

Igor Brejc
Using the latest nightly build did the trick. The real problem was that I hard coded the path to NAnt in the ccnet.config file, and forgot to point it to the latest build. Thanks to everyone for the help!
Michael La Voie