icelava.net

why be normal?
Welcome to icelava.net Sign in | Help
in Search

Determine Public Key Token of strong-named assembly not in GAC

Last post 12-06-2007, 19:17 by Anonymous. 1 replies.
Sort Posts: Previous Next
  •  12-26-2005, 0:25 1202

    Determine Public Key Token of strong-named assembly not in GAC

    (I am not too sure why this isn't documented more around the Internet, but what the heck, I'll log it down then.)

    It is pretty easy to launch the .NET Configuration MMC to show the Public Key Tokens of strong-named assemblies, that exist in the Global Assembly Cache. What of other assemblies lying around in the filesystem that have not found its way in for global sharing?

    When that question was posed to me, my first action was to lookup sn.exe, the .NET Framework's Strong Name Utility - the very tool that generates private-public key pairs to make strong naming possible in the first place.

    And there it is, the -T flag. To query the target assembly and display its Public Key Token. (Note that Infragistics actually installs their assemblies into the GAC, but I am just using theirs as a quick sample.)

    C:\Program Files\Infragistics\NetAdvantage 2004 Volume 3\ASP.NET\Bin>sn -T Infragistics.WebUI.Shared.v4.3.dll

    Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
    Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

    Public key token is 7dd5c3163f2cd0cb


    To show the actual Public Key as well, use the -Tp flag.

    C:\Program Files\Infragistics\NetAdvantage 2004 Volume 3\ASP.NET\Bin>sn -Tp Infragistics.WebUI.Shared.v4.3.dll

    Microsoft (R) .NET Framework Strong Name Utility  Version 1.1.4322.573
    Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

    Public key is
    002400000480000094000000060200000024000052534131000400000100010001afa6285b0af5
    cdd03aa2b6fdaf33fc4759cf9cd9bcf8b778ae60b9fcf71fc8126b78dbf930519614013b799929
    7907dd9c00bcc487a14f4c6733fe9adb96c053f005d7148f1666fcb882a0f9ba4307c85694b332
    2889dab357ad5cefd72ccc45e1b6973bdd2f15b2a300077b8d9de30739200887c5407c8a68c903
    45cbc4f1


    Public key token is 7dd5c3163f2cd0cb

  •  12-06-2007, 19:17 2066 in reply to 1202

    Re: Determine Public Key Token of strong-named assembly not in GAC

    Just what I needed..thank you
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems