Assembly generation failed — Referenced assembly does not have a strong name
Posted by scmay on July 17, 2008
Generate a snk key
Link here : http://forums.asp.net/t/1060132.aspx
First, you need to create a Public/Private Key Pair.
Choose >Start, >Programs, >Microsoft Visual Studio 2005, >Visual Studio Tools, >Visual Studio 2005 Command Prompt.
Enter the following at the command prompt and then press Enter…
sn -k C:\Temp\sgKey.snk
Now the key pair is created.
Basically, you have to disassemble and reassemble
Found this here http://forums.msdn.microsoft.com/en-US/clr/thread/35930958-9775-4e56-bd38-0362d124ffc4/
Solution of the assigning the strong name to the third part DLL by using following command on visual studio command prompt.
E.g. Lets say the name of the third party DLL is myTest.dll.
Step 1: Dis-assemble the assembly
ildasm myTest.dll /out:myTest.ilStep 2: Re-Assemble using your strong-name key
ilasm myTest.il /res:myTest.res /dll /key:myTest.snk /out:myTestSN.dllThis code work perfectly to assign strong name.
for verification you can use following command,
sn -vf myTestSN.dllFrom
Nimit Patel
nimit_104@yahoo.com
Naresh Gupta said
This is not working for me, while using Ilasm I am getting failure messages and in the end ** FAILURE **, what I am doing wrong?
scmay said
What kind of failure messages?
How to Get Six Pack Fast said
After reading through the article, I feel that I really need more information on the topic. Can you share some resources please?
scmay said
I am not exactly sure what information are you looking for. Do you want resources on snk, or other types of solution to the topic error that you are getting, or generating public/private snk keys?
Bhagwan Bharose said
@Naresh,
It may be due to your dll is read only.
Remove it and try….
Kerem said
It works! Thanks,
For the failure message like the Naresh saw, you just have to give the full path of the key file Previously generated to the assemble command.
Sa Mo Hung said
yes it works. thanks!
Abhishek Patel said
Thanks, It works for me … 🙂
-Abhishek Patel