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


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.

优质内容筛选与推荐>>
1、[导入]4xx元也玩热管 700/2000双热管9500GT
2、在性能测试时使用nmon进行监控服务器性能
3、登录时@RequestBody报的错
4、unity, yield return new WaitForSeconds(waitTime) 在 Time.timeScale=0下卡死
5、使用after来清除父浮动效果示意


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号