Welcome to MSDN Blogs Sign in | Join | Help

Why would you still get "Strong name validation failed"?

There are not many web pages mentioning this so I would just post this so it comes up in search. Having personally spent 4 hours tracking this little thing down, I would want anyone else to go through same :).

So... if you are using delay signing, you will need to run the following command so you can still debug from Visual Studio.Net:

sn -Vr *,[public key token]

Apparently if you are using Vista 64-bit it just won't work! You will still keep getting error something like,

Could not load file or assembly '[Your file], Version=2.0.0.0, Culture=neutral, PublicKeyToken=[public ket token]' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)


You can try viewing Fusion log, cleaning solution, rebooting machine, watch FileMon, run Process Explorer, rebuild everything 10 times... but it just won't work. Infect if you try removing signing and if your app is WPF 3.5 then you might even get even more weird errors like

Could not create an instance of type 'StaticExtension'


The solution is hidden in a one liner in Dan Wahlin's blog:

If you're running a 64-bit installation of Vista you'll need to use the sn.exe located at C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\sn.exe


I'm pretty sure tons of developers adopting shiny 64-bit OS are/would run in to this. The root cause here is sn.exe designed for 32-bit doesn't error out instead it happily lets you know that "Verification entry added for assembly '*,*'" successfully! It's not! So I also filed a bug in out Connect web site. Please vote to make 64-bit world a better place!

Published Thursday, May 01, 2008 12:34 AM by shitals

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Thursday, September 04, 2008 2:20 PM by Thank You

# re: Why would you still get "Strong name validation failed"?

Thank you for posting this....It worked for me.

Thursday, September 04, 2008 2:20 PM by Thank You

# re: Why would you still get "Strong name validation failed"?

Thank you for posting this....It worked for me.

Monday, December 01, 2008 10:21 PM by Jimmy

# re: Why would you still get "Strong name validation failed"?

Didn't work for me. I get the "Verification entry added for assembly" message, but then it still doesn't work. I also tried to verify with -v, and I still get message saying verification failed. Are there any suggestions for how to debug this?

Friday, February 13, 2009 7:32 PM by Some Guy

# re: Why would you still get "Strong name validation failed"?

THANK YOU!

Just saved me a huge amount of trouble.  :D

Wednesday, July 15, 2009 8:38 PM by Charlie

# re: Why would you still get "Strong name validation failed"?

Thanks for saving me from hours of trouble

Wednesday, July 29, 2009 1:54 AM by Xin

# re: Why would you still get "Strong name validation failed"?

Thanks a lot, it works for me too

Thursday, August 06, 2009 5:43 PM by Mark

# re: Why would you still get "Strong name validation failed"?

Thanks, this helped a lot. One thing, it isn't that the 32 bit version doesn't work on x64. It just writes to the 32 bit registry hive so it will work if your main process that is trying to load the assembly is a 32 bit process. Otherwise, if it is a 64 bit process, then you would need to have the entry in the 64 bit registry hive.

Thursday, September 03, 2009 11:36 AM by Nicholas

# re: Why would you still get "Strong name validation failed"?

Thank you so much. I wasted hours trying to figure out why skipping strong name validation wasn't working for my assembly. It's because it was a 64-bit assembly!

Thursday, October 01, 2009 3:26 PM by Craig

# re: Why would you still get "Strong name validation failed"?

Thanks as so many other have said! I spent about 2 hours on this until I found your post :o)

Monday, October 05, 2009 4:50 PM by Jay

# re: Why would you still get "Strong name validation failed"?

thank you for the info, I installed vmware with xp as guest os and tried to work around as I could not resolve the problem, untill I stumbled accross your post...

thanks again for sharing

one happy :) Jay

Tuesday, October 13, 2009 1:29 PM by Matt

# re: Why would you still get "Strong name validation failed"?

It seems that the converse is true here too - if you're on a 64-bit machine and you want to skip strong name validation for a 32-bit process, you have to use the 32-bit version of sn.exe to do this.  Running the 64-bit version against a 32-bit process did not resolve the problem for me.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker