Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NANT 0.92 SDK 7 not found

Tags:

nant

Environment:

Windows 2008 R2 64Bit SDK installed at C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1

Framework installed at C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Trying to run Nant to compile some .NET 4 classes and we are getting the following message.

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()

In looking at the NANt.exe.config it would appear that it looks to the registry to find the applicable path for the 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>

The key does not exist in the registry nor does our SDK version match the minwinsdkver="v7.0A"

Anyone run into this issue and found a valid work-around?

like image 644
user1512541 Avatar asked Nov 13 '22 02:11

user1512541


1 Answers

Simplest solution is to add the key to the registry.

For myself the registry entry was slightly different: at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework set sdkInstallRootv2.0=C:\Program Files\Microsoft SDKs\Windows\v7.0A.

After this Nant compiled fine as expected.

like image 123
Richard Avatar answered Dec 27 '22 13:12

Richard