Assembly generation failed — referenced assembly does not have a strong name

I was asked a question today about assembly does not have a strong name.

The email was excellently written because it explained the problem and had screen shots

 

Hosk

Was wondering if you’ve came across this error before.

Assembly generation failed

I looked at Microsoft and they talk about Wrapping Assembly Key File but can’t find it in Visual Studio.

Assembly key file

 

Hosk Reply

CRM Developers will often meet this error and it’s usually because they have forgotten to sign the CRM plugin they are trying to deploy.

Is the dll referenced a project/dll you created, you may need to sign it

http://msdn.microsoft.com/en-us/library/ms247123(v=vs.90).aspx

 

I have come across this before and it was because a DLL I was using wasn’t strongly named, I would add this is a bit unusual.

This got me curious as why we sign are projects/dlls.  I found this article on Microsoft

What is strong naming

Strong-name signing, or strong-naming, gives a software component a globally unique identity that cannot be spoofed by someone else. Strong names are used to guarantee that component dependencies and configuration statements map to exactly the correct component and component version.

A strong name consists of the assembly’s identity (simple text name, version number, and culture information), plus a public key token and a digital signature.

 

Reasons to use strong naming

Strong-naming gives an application or component a unique identity that other software can use to refer explicitly to it. For example, strong-naming enables application authors and administrators to specify a precise servicing version to be used for a shared component. This enables different applications to specify different versions without affecting other applications. In addition, you can use the strong name of a component as security evidence to establish a trust relationship between two components.

What Must Be Strong-Named

You must strong-name the following:

  • DLLs, if you want to deploy them to the global assembly cache (GAC).
  • ClickOnce application and deployment manifests. By default, the Visual Studio project system enables this for ClickOnce-deployed applications.
  • Primary interop assemblies, which are used for COM interoperability. The TLBIMP utility enforces strong-naming when creating a primary interop assembly from a COM type library.

 

This article called Strong Names Explained is also good

If you have a DLL which you are refrencing which doesn’t have a strong name then one of the options you have is to strongly name the DLL yourself by quickly reverse engineering the dll, getting the code and adding a key.

 

The person was able to compile his project by following the instructions in the blog below

http://ianpicknell.blogspot.de/2009/12/adding-strong-name-to-third-party.html

 

This solution involves decompiling the DLL and then compiling it and adding a key, so the DLL is then strongly named.

 

 

Advertisement

3 thoughts on “Assembly generation failed — referenced assembly does not have a strong name

  1. Covert Conversation Download October 2, 2014 / 4:52 am

    certainly like your web-site however you need to check the spelling on several of your posts.
    Several of them are rife with spelling issues and I to find it very troublesome to
    tell the reality then again I will certainly come back again.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.