In this post we will see how we can create strong names using Visual Studio Command Prompt. Here I am going to use Visual Studio 2012. Before going through the steps to create a strong name, we will define what exactly a strong name is. I hope you will like this.
Basically a strong name is a container which consists of assembly’s information. For example, it contains the name of the assembly, culture information, version number, public key, and digital signature. It can be generated using developer tools like visual studio command prompt from an assembly file.
The strong names are unique (and yeah it must be). By creating an assembly with strong names you can make sure that the name is globally unique. You can find some more information about strong names here.
If you need to find the public key of a DLL, you can see here: How to find PublicKeyToken of a DLL
Steps to Create Strong Names
Step 1: Opening visual studio command prompt
To open a command prompt, you can either go to shortcuts from the directory as,
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts
Or you can go to start, then type Visual Studio-> You can find Visual Studio Tools folder.
Step 2: Run Command Prompt
Just click on the command prompt and run as administrator.
Step 3: Creating .snk file
To create a strong name, you need to run the following command in the command prompt.
Here, the visual studio and framework versions will be changed as your version. And the strong name strong.snk will be created in the C drive root directory.
Once you run that command, you can see an output as follows.
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.33440
Copyright (c) Microsoft Corporation. All rights reserved.
Key pair written to c:\strong.snk
Conclusion
Did I miss anything that you may think that is needed? Did you find this post useful? I hope you liked this article. Please share with me your valuable suggestions and feedback.
Your turn. What do you think?
A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.
Please see this article in my blog here.




Pankaj Kumar ChoudharyPosted Feb 6, 2016, 7:53 PM
Nice Explain Sir... Sir can you explain me what are the purpose and use of creating strong name... Thanks
Santhakumar MunuswamyPosted Feb 5, 2016, 3:39 PM
Thanks for nice article
Jaco ZwartsPosted Feb 5, 2016, 12:17 PM
Nice Article
Ankur MistryPosted Feb 5, 2016, 3:50 AM
Nice Sibeesh Venu
Shubham KumarPosted Feb 5, 2016, 12:12 AM
Why are there so many assemblies from Microsoft with the same public key token?
Sibeesh VenuPosted Feb 5, 2016, 12:00 AM
Raja T Thanks much :)
Sibeesh VenuPosted Feb 5, 2016, 12:00 AM
Mohammed Ibrahim Thanks much :)
Sibeesh VenuPosted Feb 4, 2016, 11:59 PM
Debasis Saha Thanks much :)
Sibeesh VenuPosted Feb 4, 2016, 11:59 PM
Pramod Thakur Thank you
Raja TPosted Feb 4, 2016, 10:48 PM
Nice,Thanks for sharing
Mohammed IbrahimPosted Feb 4, 2016, 1:44 PM
nice
Debasis SahaPosted Feb 4, 2016, 9:54 AM
Nice Share..
Pramod ThakurPosted Feb 4, 2016, 2:36 AM
nice..