Click here to Skip to main content
Click here to Skip to main content

Referenced assembly does not have a strong name

By , 7 Mar 2012
 

Introduction

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 /out=Test.il 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 Test.il

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.

License

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
Member
has 4 + Total Experience in Microsoft.Net Environment.
 
2 + year Excperience in .Net Development with C# and SQL Server 2005/2008.
 
2 + Experience in WPF/Silverlight.
 
Current area of Development in Mono for Android (Xamarin), Silverlight/ WPF and Windows Phone 7 Application.
 
Follow him on : http://hirenkhirsaria.blogspot.com/

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
AnswerThanks I got my answer.memberkrunal298416 May '13 - 2:34 
QuestionError in the last sentencememberd.chang30 Apr '13 - 5:20 
AnswerRe: Error in the last sentencememberHiren Khirsaria30 Apr '13 - 19:22 
QuestionAnother waymembergbsistemas19 Aug '12 - 7:44 
AnswerRe: Another waymemberHiren Khirsaria19 Aug '12 - 22:07 
QuestionThoughtsmemberPIEBALDconsult7 Mar '12 - 7:57 
AnswerRe: ThoughtsmemberHiren Khirsaria9 Mar '12 - 0:36 
GeneralRe: ThoughtsmemberPIEBALDconsult9 Mar '12 - 2:18 

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

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