Search code examples
.netnantwindows-server-2008-r2

Running Nant 0.86 in Windows Server 2008 R2


Hi i'm trying to run Nant but keep getting this error when i tried to build

Failed to initialize the 'Microsoft .NET Framework 3.5' target framework Property evaluation failed Expression:$> Property 'sdkInstallRoot' has not been set

I have .Net framework 4.0 running previously is 3.5;is there a work around for this?What do i need to do?


Solution

  • This is an NAnt configuration problem - for the target framework "net-3.5", the "sdkInstallRoot" property is being read from a non-existent Registry key.

    The details may vary based on your server and its configuration, but in general you will need to a) ensure that the appropriate .NET and Windows SDKs are installed on your server, and b) that NAnt.exe.config properly references the Registry.

    Look in your config file for the <framework> section with the name "net-3.5". Inside of that element, there is another element called <project>. It defines the properties installRoot and the problematic sdkInstallRoot. Version 0.86 does not use the registry keys applicable to Vista and later operating systems. The actual SDK installation folder key could be one of a few names - use regedit.exe to find out.

    On my machine, for instance, sdkInstallRoot is defined as:

    <readregistry
        property="sdkInstallRoot"
        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK\InstallationFolder"
        hive="LocalMachine"
        failonerror="false" />
    

    Verify that the registry key as named exists, and if not, correct your config file. That should fix your problem!