SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our company purchased a certificate to sign our assemblies. But if I go the signing tab in project properties and select the certificate there, I'll get the following error: "an attempt was made to reference a token that does not exist"

My colleague got this to work with a post build command that uses the signtool, which works perfect for console applications etc. but not for sharepoint assemblies.

If I use the post build command and don't check "sign the assembly" in the signing tab, I can't deploy or debug and get this error: "Value cannot be null. Parameter name: PublicKey"

If I use the post build command and check "sign the assembly" and use the key.snk, I can deploy and debug, but my assembly isn't signed with the custom certificate.

Is there anyone who knows how to sign the assembly using a custom certificate? Or is this just not possible at all?

share|improve this question
You need to sign SharePoint assemblies!? – Amit Kumawat Nov 30 '11 at 10:36
I don't think he's attempting to sign "Microsoft.SharePoint.dll" - but his own assemblies. But then this is my assumption - OP can you clarify the name of the assembly you are trying to sign. – Ryan Nov 30 '11 at 15:06
You're right, I didn't mean the Microsoft.SharePoint.dll, but my custom dll's to use in sharepoint :) – Marlou Dec 1 '11 at 9:09
up vote 1 down vote accepted

Strong naming an assembly and code signing (Authenticode) are two entirely separate things (despite the fact that they use very similar technology and similar names) - and you are mixing these up.

You can not use a Code Signing SSL certificate to 'strong name' an assembly - this has to be an .snk file in he "Signging - Sign the assembly" section of visual studio properties.

If you want to code sign (Authenticode) an assembly then this has to be done by SIGNTOOL.EXE in postbuild - and again you can't use a strong name .snk file for this it has to be your code signing ssl certificate (.pfx)

share|improve this answer
Thanx for explaining, I thought this was the same. :) I'm going to use an .snk to strong name my assembly. – Marlou Dec 1 '11 at 9:10

SharePoint assemblies are already signed from Microsoft, You can(read have to) trust the code's authenticity.May be you want to sign your assemblies.

If you want to sign your own assembly, Check this out

If you want to sign an existing assembly for which you don't have source code, Check this

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.