Click here to Skip to main content
13,457,438 members
Click here to Skip to main content
Add your own
alternative version


17 bookmarked
Posted 7 Mar 2012

Referenced assembly does not have a strong name

, 7 Mar 2012
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
Team Leader Reputed IT Company
India India
Having 9+ years of experience in Microsoft.Net Technology.
Experience in developing applications on Microsoft .NET Platform ( Asp.Net, WPF, Silverlight, Windows Phone 7/8).
Experience and knowledge of software design methodologies (Agile), object oriented design, and software design patterns (MVVM).
Experience in Developing android mobile application using Xamarin (mono for android) framework.

Follow him on :

You may also be interested in...

Comments and Discussions

QuestionAnother way Pin
gbsistemas19-Aug-12 7:44
membergbsistemas19-Aug-12 7:44 
AnswerRe: Another way Pin
Hiren Khirsaria19-Aug-12 22:07
memberHiren Khirsaria19-Aug-12 22:07 
Thanks for your feedback

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

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

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