环境:
Windows 2008 R2 64Bit SDK 安装在C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1
框架安装在C:\Windows\Microsoft.NET\Framework64\v4.0.30319
尝试运行 Nant 来编译一些 .NET 4 类,我们收到以下消息。
The SDK for the 'net-4.0' framework is not available or not configured.:
NAnt.Core.BuildException: The SDK for the 'net-4.0'
framework is not available or not configured.
at NAnt.Core.Tasks.ExternalProgramBase.DetermineFilePath()
at NAnt.Core.Tasks.ExternalProgramBase.get_ProgramFileName()
at
NAnt.Core.Tasks.ExternalProgramBase.PrepareProcess(Process process)
at NAnt.Core.Tasks.ExternalProgramBase.StartProcess()
at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean
forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
在查看 NANt.exe.config 时,它似乎会查看注册表以找到 SDK 的适用路径。
<project>
<readregistry
property="installRoot"
key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"
hive="LocalMachine" />
<locatesdk property="sdkInstallRoot"
minwinsdkver="v7.0A" minnetfxver="4.0" maxnetfxver="4.0.99999"
failonerror="false" />
</project>
注册表中不存在密钥,我们的 SDK 版本也不匹配 minwinsdkver="v7.0A"
有人遇到此问题并找到有效的解决方法吗?