Answered by:
Unable to sign assemblies - Authenticode key

Question
-
Before yesterday I was using a self-sign key for my four assemblies under Project Settings->Signing and Sign the Assembly. Yesterday I finally received authorization to get an authenticode key from the issuer Entrust. What perplexed me a bit is that the certificate in question was not downloaded but installed to my certificate store directly. I'm not sure if this is really how it is supposed to work but I shrugged it off. I exported the certificate (Yes to the private key) and Include all Certs with Export all extended properties into a pfx file, gave it a password and all that fun stuff.
Then I try to use my above signing method. No dice. "Cannot find the certificate and private key for decryption". Okay, this suggested that I export again without the extended options (Include all and extended properties). Try the same signing procedure from before and it seems to take. Great. Compile and...
Cannot import the following key file: AuthenticodeKey.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_8388B6E02FCF349E
Searching around gave me the suggestion of using sn -i to install the key, but that just failed entirely since I had a hard time finding where sn was in the first place while it just wouldn't take. For fun I tried to put the key in a different project in the same solution. After I put in the password I get "An attempt was made to reference a token that does not exist". Searching for this was too broad so I have not an answer as to why this is happening.
Where did I go wrong?
- Moved by Amanda Zhu Tuesday, September 23, 2014 3:17 AM not visual studio general issue
Friday, September 19, 2014 3:18 PM
Answers
-
Hello Zero,
Welcome to MSDN forum.
Your issue about signing assembly is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor. I suggest consulting your issue on some development forums based on the type of you project.
Anyway, I will move your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
For the current error: Cannot import the following key file: AuthenticodeKey.pfx. The key file may be password protected, one suggested way to resolve such issue is to install a key pair from <infile> into a key container named <container> using SN.exe tool: Strong Name Tool (Sn.exe) in Visual Studio Command Prompt
Similar threads with multiple workarounds for this error:
There are other solutions in the second link, you can reference it.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Dave PatrickMVP Sunday, September 28, 2014 2:08 PM
- Marked as answer by Just Karl Thursday, October 9, 2014 4:55 PM
Tuesday, September 23, 2014 3:16 AM
All replies
-
Hello Zero,
Welcome to MSDN forum.
Your issue about signing assembly is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor. I suggest consulting your issue on some development forums based on the type of you project.
Anyway, I will move your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
For the current error: Cannot import the following key file: AuthenticodeKey.pfx. The key file may be password protected, one suggested way to resolve such issue is to install a key pair from <infile> into a key container named <container> using SN.exe tool: Strong Name Tool (Sn.exe) in Visual Studio Command Prompt
Similar threads with multiple workarounds for this error:
There are other solutions in the second link, you can reference it.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Dave PatrickMVP Sunday, September 28, 2014 2:08 PM
- Marked as answer by Just Karl Thursday, October 9, 2014 4:55 PM
Tuesday, September 23, 2014 3:16 AM -
I ended up finding signtool before you got your answer up. But yeah, apparently that is the way to do it.Thursday, October 2, 2014 3:39 PM