Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see the strong name of my assembly?

I have a project, and I created a strong name key file for it.

How can I tell what the strong name of my assembly is? It seems this should be obvious, but I can't find any reference to it.

like image 630
Jeremy Holovacs Avatar asked Jun 29 '13 01:06

Jeremy Holovacs


People also ask

How do I find a strong assembly name?

First, right click on the Assembly DLL -> Properties -> Details. Here you can find the name, version and Culture of your Assembly. It will give you the public key.

What is strong name in net Assembly?

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.


2 Answers

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.

sn -v "C:\MyAssemblyPath" 

and to get the public token, you can do this

sn -T "C:\MyAssemblyPath" 

You can also use Reflector or ILSpy to find the public key token.

If you want to get the full name of the assembly, including the public token, you can use Assembly.FullName.

Assembly.GetExecutingAssembly().FullName; 
like image 158
keyboardP Avatar answered Sep 28 '22 10:09

keyboardP


You can get the Fully Qualified Name by using a tool like Reflector or ILSpy. Select the assembly and it should be in top of it. For XNA in ILSpy :

// C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.dll // Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553

If you don't want to use those tools, you can figure out the Fully Qualified Name using windows Explorer and Visual Studio Command Prompt.

First, right click on the Assembly DLL -> Properties -> Details. Here you can find the name, version and Culture of your Assembly.

For the public key, launch Visual Studio Command prompt and write :

sn -Tp YourAssembly.dll

It will give you the public key.

Now you can forge Fully Qualified Name.

like image 36
Patedam Avatar answered Sep 28 '22 09:09

Patedam