简体   繁体   English

在Windows Server 2008 R2中运行Nant 0.86

[英]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 嗨,我正在尝试运行Nant,但是在尝试构建时仍然出现此错误

Failed to initialize the 'Microsoft .NET Framework 3.5' target framework Property evaluation failed Expression:$> Property 'sdkInstallRoot' has not been set 无法初始化'Microsoft .NET Framework 3.5'目标框架属性评估失败表达式:$>尚未设置属性'sdkInstallRoot'

I have .Net framework 4.0 running previously is 3.5;is there a work around for this?What do i need to do? 我以前运行的.Net Framework 4.0是3.5;是否可以解决此问题?我需要做什么?

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. 这是一个NAnt配置问题-对于目标框架“ net-3.5”,正在从不存在的注册表项中读取“ sdkInstallRoot”属性。

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. 具体细节可能因服务器及其配置而异,但通常您需要a)确保服务器上安装了适当的.NET和Windows SDK,b)NAnt.exe.config正确引用了注册表。

Look in your config file for the <framework> section with the name "net-3.5". 在配置文件中查找名称为“ net-3.5”的<framework>部分。 Inside of that element, there is another element called <project> . 在该元素的内部,还有另一个名为<project>元素。 It defines the properties installRoot and the problematic sdkInstallRoot . 它定义了属性installRoot和有问题的sdkInstallRoot Version 0.86 does not use the registry keys applicable to Vista and later operating systems. 版本0.86不使用适用于Vista和更高版本操作系统的注册表项。 The actual SDK installation folder key could be one of a few names - use regedit.exe to find out. 实际的SDK安装文件夹密钥可能是几个名称之一-使用regedit.exe进行查找。

On my machine, for instance, sdkInstallRoot is defined as: 例如,在我的计算机上,sdkInstallRoot定义为:

<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. 也许您可以尝试使用最新版本的NAnt。 Current version is 0.91-alpha2 (August 17, 2010). 当前版本为0.91-alpha2(2010年8月17日)。 As the release notes state, support for .NET 4.0 has been added in 0.91-alpha1 (May 29, 2010). 发行说明所述 ,已在0.91-alpha1中添加了对.NET 4.0的支持(2010年5月29日)。 Don't worry about alpha status. 不用担心alpha状态。 We're using this version in our production environment without any problems. 我们在生产环境中使用此版本没有任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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