Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Strongly Name an Assembly so that it has a Public Key Token

I am trying to create a Project Template Wizard. For that I need a strongly named Assembly with a Public Key token.

I went here: http://msdn.microsoft.com/en-us/library/ms247123.aspx and followed the steps.

I end up with a .pfx file in my assembly. But when I clean and build the dll does not have a Public Key Token on it.

(I verified via running 'sn -t EventWizard.dll' and I got this as a result:

Failed to convert key to token -- The public key for assembly '(null)' was invalid.

So I don't think I am getting a Public Key Token. How can I get one?

Update: Here is my Signing Tab:

Signing Screenshot

like image 317
Vaccano Avatar asked Nov 27 '22 22:11

Vaccano


2 Answers

I also faced with this.

Solution is very simple - arguments are case sensitive.

sn -T <yourassembly.dll>
like image 61
13_Shark Avatar answered Dec 09 '22 13:12

13_Shark


So it was strongly named after all. But the sn.exe tool needed to be used in a different way to see the value I was looking for (PublicKeyToken).

If I ran this:

sn -e EventWizard.dll temp.txt
sn -t temp.txt

Then it worked just fine.

like image 34
Vaccano Avatar answered Dec 09 '22 13:12

Vaccano