Not a subscriber?

Join thousands of others who are building self-directed lives through creativity, grit, and digital strategy—breaking free from the 9–5.
Receive one free message a week

NAnt: SdkInstallRoot has not been set

I’ve had this error pop up nearly 20 times when setting up CCNET through the years. Unfortunately I never notated what I had to do to fix it. I usually just spent 20 minutes banging my head against the wall trying to figure it out. Then when I finally do figure it out I never notate it down. Well, this time I’m going to notate it here so I can fix it next time real quick and hopefully someone else will find this useful through “teh internets” as well.

 

The Error

BUILD FAILED

Failed to initialize the ‘Microsoft .NET Framework 2.0’ (net-2.0) target framework.

    Property evaluation failed.
Expression: ${path::combine(sdkInstallRoot, ‘bin’)}
                            ^^^^^^^^^^^^^^

        Property ‘sdkInstallRoot’ has not been set.

Expression: ${path::combine(sdkInstallRoot, ‘bin’)}

How to Resolve

Open the nant.exe.config file and scroll down until you find this entry.

<readregistry
property="sdkInstallRoot"
key="SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0"
hive="LocalMachine"
failonerror="false" />

 

You’re going to replace the Key with this:

<readregistry
property="sdkInstallRoot"
key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.1\WinSDKNetFxTools\InstallationFolder"
hive="LocalMachine"
failonerror="false" />

 

We’re changing the location of the sdk’s install root.

 

Now, everything should be gravy. Key word: SHOULD