Visual Studio tip: Get Public Key token for a strong named assembly

Source: Internet
Author: User
Tags reflector

The first 3 parts are easy to get. I shoshould know the name, version, and culture for the Assembly since I am writing it. the part that can be a little harder to locate is the Public Key token for my signed assembly. one common way to do this is to use reflector to open my assembly and get the token (actually, reflector will give you the entire fully qualified name as in the example above ). for me, that is just too much work. if I have the project in Visual Studio already, I wocould much rather just click a menu item in Visual Studio to get the result. here is how that can be set up:

In Visual Studio, go to the Tools menu and click the external Tools menu item. this will bring up the external tools dialog. the image below shows the information that I have added to add a new menu item called 'get Sn token '.

 

The command is the path to sn.exe which can be in different places depending on your vs version. the easiest way to find it is to open a vs command prompt and type "where sn.exe ". the arguments field is set to-T and then the $ (targetpath) variable. the "use output window" option is checked so that the results will be shown in the vs output window. after clicking OK, this will be enabled as a menu item as shown below.

 

The output for this command will be displayed in the output window. This also works if you have multiple projects in the same solution. Just highlight the project in Solution Explorer and then click the menu item.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.