tags:

views:

288

answers:

2

I'm trying to build / sign an assembly on a Windows 7 machine and I get the following exception:

x:\> SN -q -Vr "x:\someassembly.dll"
Failed to open registry key -- Access is denied.

I've found the following thread that appears to be the same problem, and it mentions that he fixed it by changing permissions on a registry key, however it doesnt mention which registry key.

http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/e84e015b-41c8-4170-8686-2474832fcd28

Has anyone encountered this before?

A: 

If that is the case you may use Process Monitor to see which registry key sn.exe is trying to access. This is not really programming related though.

Christian Vik
A: 

Ok, I identified the key in question using Process Mon, which lists the following:

sn.exe
RegCreateKey
HKLM\SOFTWARE\Wow6432Node\Microsoft\StrongName
ACCESS DENIED
Desired Access: Maximum Allowed

Giving write access for the current user to the following key fixed this problem

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft

Note that giving write access to the root HKLM node didnt fix my problem (apparently permissions of folders in the registry aren't recursive?)

Kragen