Extracting Public Key from Signed Assembly
Once an assembly has been signed you can extract the public key token using the ‘sn’ .NET utility. This is necessary if you need to create a reference to an assembly, for example in the form:
<Field Name=”FieldTypeClass”> RatingField.RatingField,RatingField, Version=18.104.22.168,Culture=neutral, PublicKeyToken=ef9f3072afebf3b0 </Field>
To do this:
- Run a Visual Studio 2005 command prompt (Visual Studio Tool + Visual Studio 2005 Command Prompt from the “Start” menu).
- Enter the following command:
sn -Tp ratingfield.dll
Where “ratingfield.dll” is the name of the signed assembly.