publicKeyToken

P

Pavel Minaev

Where would I find the publicKeyToken for my simple DLL class?

This MSDN site shows how I want to use it:

http://msdn.microsoft.com/en-us/library/0ash1ksb(VS.80).aspx

When I look in my class's AssemblyInfo.cs file, I see where it was issueda
GUID (Not sure why! It does not contain a GUI...), but ther is nothing about
a publicKeyToken.

First of all, a GUID has nothing to do with GUI. The first is
"Globally Unique IDentifier", the second is "Graphical User
Interface".

Also, public key token is not associated with class; it is rather a
property of the assembly. If you want it, you'll have to sign your
assembly. To do this in Visual Studio, go to Project properties,
select the "Signing" tab on the left, tick "Sign the assembly"
checkbox, and generate a new keyfile via the combobox which will then
be enabled. If you want to do this manually without VS, read the
documentation on sn.exe utility on MSDN - it comes with .NET SDK.

Then, you can get the public key token of a signed assembly by using
sn.exe:

sn.exe -T MyAssembly.dll
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top