How to Find Your Public Key Token in .NET Assembly

Learn how to locate your public key token using Visual Studio Command Prompt or ILDasm.

24 views

To find your public key token, open the Visual Studio Command Prompt and run the `sn -Tp <your_assembly>.dll` command. This will display the public key token of your assembly. Ensure you replace `<your_assembly>` with your actual assembly file name. Alternatively, you can use tools like ILDasm to inspect the assembly and locate the public key token.

FAQs & Answers

  1. What is a public key token? A public key token is a unique identifier for a strong-named assembly in .NET, derived from the public key used to sign the assembly.
  2. Why do I need to find my public key token? Finding your public key token is essential for referencing and ensuring the integrity of .NET assemblies in applications.
  3. Can I find the public key token without Visual Studio? Yes, you can use tools like ILDasm to inspect the assembly and find the public key token without using Visual Studio.
  4. What command should I use in a command prompt to find my public key token? You should run the command `sn -Tp <your_assembly>.dll`, replacing `<your_assembly>` with the name of your assembly file.