views:

819

answers:

3

I'm using TeamCity to manage one of my projects however it doesn't seem to be working well with Nant on Windows Server 2008. What can I do to fix this?

BEFORE Installing the ASP.NET 2.0 Framework SDK:

[10:21:07]: BUILD FAILED
[10:21:07]: Failed to initialize the 'Microsoft .NET Framework 2.0' (net-2.0) target framework.
[10:21:07]:     Property evaluation failed.
[10:21:07]: Expression: ${path::combine(sdkInstallRoot, 'bin')}
[10:21:07]:                             ^^^^^^^^^^^^^^
[10:21:07]:         Property 'sdkInstallRoot' has not been set.

AFTER:

[11:48:16]: Target framework: Microsoft .NET Framework 2.0
[11:48:16]: Target(s) specified: test 
[11:48:16]:  [property] Target framework changed to "Microsoft .NET Framework 3.5".
[11:48:16]: BUILD FAILED
[11:48:16]: INTERNAL ERROR
[11:48:16]: System.NullReferenceException: Object reference not set to an instance of an object.
[11:48:16]:    at NAnt.Core.FrameworkInfo.get_Version()
[11:48:16]:    at NAnt.Core.Project.UpdateTargetFrameworkProperties()
[11:48:16]:    at NAnt.Core.Tasks.PropertyTask.ExecuteTask()
[11:48:16]:    at NAnt.Core.Task.Execute()
[11:48:16]:    at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
[11:48:16]:    at NAnt.Core.Project.Execute()
[11:48:16]:    at NAnt.Core.Project.Run()
[11:48:16]: Please send bug report to [email protected].
[11:48:16]: Total time: 0.1 seconds.
[11:48:16]: Process exited with code 1
[11:48:16]: Build finished
A: 

A couple of things that may cause this.

  1. You do not have the full .Net 2.0 SDK installed.
  2. You are missing some registry keys. If you look in the registry of say a windows xp / vista machine and search for the sdkInstallRoot you will probably find it. THen just replicate the code to your server.

However to verify that you have the .net framework sdks installed @ least just go to the C:\windows\Microsoft.net folder and go to the version you need and search within to try and find say the csc.exe or vbc.exe programs. If you cannot find them then you do not have the SDK installed but more than likely have the runtime installed.

Give that a go and see if that helps.

Joshua Cauble
A: 

When using Nant with a Windows Server 2003 64 bit server I had to download a nightly build as Nant 0.86 beta 1 has 64 bit issues. I did get it to work but I am not sure if it will work with Windows Server 2008. Nant has been in beta for ever. If you are stuck to Nant try a nightly build if not I recommend MSBuild for .Net 2+ and 64 bit machines.

For more info check out this article MsBuild vs. Nant

runxc1 Bret Ferrier
A: 

I've run into similar issues with NAnt. I know this isn't the Best solution, but it is one that works if you need to get your project moving.

I've found that installing a development environment (C# Express didn't work for me, but VS 2008 did) on the server makes this issue go away. (Yes, I realize this goes against normal best practices, but it works and lets my scripts run so I can get back to coding.)

Just figured I'd share incase anyone else is in a similar situation..(this has worked for me both with CruiseControl.Net and with Hudson).

Peter Bernier
I came back to this. A better solution is simply to install the 2.0 SDK. This seems to be required even with a higher version (I had the 3.5 SDK) already installed.
Peter Bernier