简体   繁体   中英

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?

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!

Perhaps You give the latest version of NAnt a try. Current version is 0.91-alpha2 (August 17, 2010). As the release notes state, support for .NET 4.0 has been added in 0.91-alpha1 (May 29, 2010). Don't worry about alpha status. We're using this version in our production environment without any problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM