Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is strong naming and how do I strong name a binary?

Tags:

c#

.net

vb.net

I heard somewhere that I need to strong name my binaries before I distribute them. Any ideas what this is?

like image 698
esac Avatar asked Sep 17 '09 05:09

esac


People also ask

What is strong naming?

Strong naming refers to signing an assembly with a key, producing a strong-named assembly. When an assembly is strong-named, it creates a unique identity based on the name and assembly version number, and it can help prevent assembly conflicts.

How do I know my strong name?

You can use the Strong Name tool to determine if the assembly is strongly named. In command prompt you can do this to verify it is a strong named assembly. You can also use Reflector or ILSpy to find the public key token.

What is strong name in C# and how can we use it?

A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. It is generated from an assembly file using the corresponding private key.


1 Answers

Eric Lippert posted about strong signing assemblies recently:

The purpose of a strong name is solely to ensure that when you load an assembly by name, you are loading exactly the assembly you think you are loading. You say "I want to load Frobber, version 4, that came from FooCorp". The strong name gear ensures that you actually load precisely that DLL, and not another assembly called Frobber, version 4, that came from Dr. Evil Enterprises. You can then set security policy which says "if I have an assembly from FooCorp on my machine, fully trust it." These scenarios are the only by-design purposes of strong names.

like image 178
Timothy Carter Avatar answered Sep 21 '22 06:09

Timothy Carter