Thursday, December 23, 2010

Strong name validation failed. on 64bit windows - 32bit Visual Studio

If you are running a 32bit version of Visual Studio on a 64bit Windows version, and want to add a strong name exception for a delay signed assembly, the usual methods of running

"sn -Vr *, [public key token]"


Example:
sn -Vr *,89845dcd8080cc91

or adding the registry key manually to

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\"

Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,89845dcd8080cc91]

would not work.

The reason being that the 64bit windows registry has a separate area for 32bit applications. And, the sn.exe is not updating that.

To work around it, you have to add your strong name exceptions to the following location of the windows registry.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\


Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,89845dcd8080cc91]