Visual Studio Tip: Get Public Key Token for a Strong Named Assembly

來源:互聯網
上載者:User

標籤:blog   http   os   io   strong   for   ar   art   

The first 3 parts are easy to get. I should 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 would 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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.