Click here to Skip to main content
11,409,097 members (61,611 online)
Click here to Skip to main content

Referenced assembly does not have a strong name

, 7 Mar 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
How to give a strong name to your assembly


Sometimes you got an error like following when you reference 3rd party dlls.

Assembly generation failed -- Referenced assembly 'Test' does not have a strong name
Cause is An assembly is not signed with a strong name, the strong name could not be verified, or the strong name would not be valid without the current registry settings of the compute.

The strong name protects clients from unknowingly loading an assembly that has been tampered with. Assemblies without strong names should not be deployed outside of very limited scenarios.

An assembly without a strong name  cannot be loaded into the global assembly cache.

To Fix this, have to follow below steps.

Steps to create strong named assembly

Step 1 : Run visual studio command prompt and go to directory where your DLL located.

  For Example my DLL located in D:/hiren/Test.dll

Step 2 : Now create il file using below command.

  D:/hiren> ildasm /all / Test.dll
  (this command generate code library)

Step 3 : Generate new Key for sign your project.

  D:/hiren> sn -k mykey.snk

Step 4 : Now sign your library using ilasm command.

  D:/hiren> ilasm /dll /key=mykey.snk

so after this step your assembly contains strong name and signed.

Jjust add reference this new assembly in your project and compile project its running now.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Hiren Khirsaria
Software Developer (Senior)
India India
has Total 5+ years of Experience in Microsoft.Net Environment. out of that,

2 + year of Excperience in .Net Development with C# and SQL Server 2005/2008.

3 + years of Experience in WPF/Silverlight.

Current area of Development in Mono for Android (Xamarin), Silverlight/ WPF and Windows Phone 7 Application.

Follow him on :

Comments and Discussions

QuestionHow to create a strong-named assembly? Pinmemberandyadams215-Feb-15 17:28 
SuggestionAutomated GUI Tool was created using this technique PinmemberNikita Mazhara4-Nov-14 0:28 
GeneralThanks man PinmemberMember 768851113-Jul-14 21:24 
QuestionHi Pinmemberhasan jamal siddiqui15-Jun-14 3:13 
QuestionVersion of ildasm needs to match version of assembly when adding strong name PinmemberMember 25245274-Jun-14 15:53 
Question3rd party .dll does not have snk PinmemberAdmin .25-May-14 20:17 
QuestionWhat if I Recompile? PinmemberJoe Sweeney10-Jan-14 9:15 
AnswerRe: What if I Recompile? PinmemberHiren Khirsaria13-Jan-14 5:45 
AnswerThanks I got my answer. Pinmemberkrunal298416-May-13 3:34 
QuestionError in the last sentence Pinmemberd.chang30-Apr-13 6:20 
AnswerRe: Error in the last sentence PinmemberHiren Khirsaria30-Apr-13 20:22 
QuestionAnother way Pinmembergbsistemas19-Aug-12 8:44 
AnswerRe: Another way PinmemberHiren Khirsaria19-Aug-12 23:07 
QuestionThoughts PinmemberPIEBALDconsult7-Mar-12 8:57 
AnswerRe: Thoughts PinmemberHiren Khirsaria9-Mar-12 1:36 
GeneralRe: Thoughts PinmemberPIEBALDconsult9-Mar-12 3:18 
Not that I recall. Altering a third-party DLL sounds like a bad idea.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.5 | Last Updated 7 Mar 2012
Article Copyright 2012 by Hiren Khirsaria
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid