← All articles
development

NAnt: SdkInstallRoot has not been set

Fix the NAnt build error where sdkInstallRoot has not been set by pointing nant.exe.config at the correct Windows SDK registry key instead.

Donn Felker

Donn Felker

2009.01.14 · 1 min read · updated July 5, 2013

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

Donn Felker

Written by Donn Felker

I've spent 25+ years shipping software, writing books, and running my own companies. I write about thinking clearly, working for yourself, and doing real work while AI rewrites the rules. New essays land here every week.

Get the newsletter

Keep reading