Getting the PublicKeyToken of .Net assemblies

前端 未结 13 1122
忘掉有多难
忘掉有多难 2020-11-30 16:57

What is the simplest way to find the Public-Key-Token of an assembly?

The simplest way I can think of would be a simple right-click, get public key, but this functio

13条回答
  •  长情又很酷
    2020-11-30 17:59

    As an alternative, you can also use linq like this -

        string key = string.Join ("",assembly
                                    .GetName()
                                    .GetPublicKeyToken()
                                    .Select (b => b.ToString ("x2")));
    

提交回复
热议问题