Build/Test Issues

Unable to find sn.exe for signing an instrumented assembly

Started by sferencik on 9,638 views

Some of my projects are strong-signed and I'm getting the following error:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_project-build-issues#0
System.ApplicationException: [h]Unable to find sn.exe for signing an instrumented assembly. Please ensure you have the Windows SDK installed[/h] - otherwise turn off signing or instrumentation
at #=q1ngaUkxJTok1Yt1TVJRpJM_yN$pNtGNAoW$i9vpYU7H3YJIbHABMmmzKpNImKEci.#=qJRi_sOB$EOzf7LJZXkrwQZ33OSlyozGP9IlCd2NSV5g=()
at #=q1ngaUkxJTok1Yt1TVJRpJM_yN$pNtGNAoW$i9vpYU7H3YJIbHABMmmzKpNImKEci.#=qWnSQpUNnG43OTW6ovDtCuWNoGmIQO8vQtOHn55sQN4I=(String #=q3LVsfxUwtMDhUz8aOT92vqHKCxIexpG4flKijiAymWg=, String #=qPUGN2z5qlC8wc9Qm2K1WKg==)
at nCrunch.Compiler.RemoteBuildRunner.#=qc19uOgHz4bbS00fHoJcJ86FdDfZxNpBz6hs6SLcoDgg=(ComponentBuildParameters #=qmVSC1mocuqkeMyG6RiWA7A==, String #=q6HotKBtAzAJ5NhAIJpJMWErw8$oIjiUT0yL0fTvBG1s=, BuildOutput #=qeo8ShH4FE1FNzdVk_FG0_g==, String #=qRmPlD1GldENhQyyoQ5tYKKyaUsmzaLiSqv0FdoKZIHA=, String[] #=qftBQ99WoQMP8nKBadgDENHqcE_v2YLLk_k2_mOUUIoM=)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)

I do have the SDK installed, and I have C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe. Both VS and MSBuild manage to produce the strong-signed assemblies. What must I do to make NCrunch find the SDK?

EDIT: I've added C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin to %PATH% (and restarted both VS and nCrunch.BuildHost.x86.exe) but the issue persists.

Thanks,
Sam

Edited

Hi Sam,

It looks as though there's a hole in NCrunch's sn.exe resolution that doesn't cater for the configuration on your dev machine. Right now NCrunch looks in the following registry locations, checking for an 'InstallationFolder' value at:

HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v8.0
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v8.0A
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v7.1
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v7.0A
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v6.0A

.. Which points to a directory under where sn.exe can be found under the 'bin' subdirectory.

Is it possible that you have a different version of the SDK installed that NCrunch isn't aware of? If you can find a reg key similar to the above and provide me with the name, I'll add it to the resolution list for the next version of NCrunch. A workaround to the problem could be to manually add a registry key under one of the above paths that will point to your "C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0" directory.
Hi Remco,

Thanks for the reply. It did help.

I have the following registry keys:
A) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0
B) HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0
C) HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v6.0A

A and B have the same contents but are not checked by NCrunch. Perhaps you should add v7.0 to your list.

C contains the path to a stale SDK installation - which would explain why it's not helping NCrunch.

Also, I wonder if NCrunch handles the Wow6432 hive (where B, C are). Probably so; just checking.

Thanks a lot.

Sam
Thanks Sam. I'll make sure the v7.0 is added to the list. NCrunch does also check for Wow6432Node, so I'm fairly certain the problem is just caused by the missed support for this particular version. Did adding one of the other registry keys allow you to work around the problem?
Yes, it did help.

I copied HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0\InstallationFolder (which contains the correct path to the SDK but is being ignored by NCrunch) to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder. That did the trick.

That also confirms that Wow6432Node is used properly.

Thanks,
Sam

(BTW: does this forum send email notifications? I don't seem to be receiving them though I'm watching this topic.)
Hi Sam,

That's great to hear. I'll see that the fix goes in with the next minor release.

Normally this forum should send notifications from forum@ncrunch.net, although you aren't the first to mention this problem - I wonder if the feature or infrastructure is having issues of some kind.


Cheers,

Remco

Post a reply

Log in to reply.