83

I maintain a large WPF application which I inherited from another developer. I use ClickOnce to publish it. Suddenly, today I got an error message: Error 2 Cannot publish because a project failed to build. 1 1
Error 3 An error occurred while signing: Failed to sign bin\Debug\app.publish\setup.exe. SignTool Error: No certificates were found that met all the given criteria.

I do have a file called SomeName.snk, which is referred in project settings, Signing tab. I have no idea what happened today that caused the problem. I use VS 2012.

Stefan Over
  • 5,851
  • 2
  • 35
  • 61
David Shochet
  • 5,035
  • 11
  • 57
  • 105
  • How did you get the full description of the error? I also use ClickOnce and Publish directly from within VS2019. I only get "An error occurred while signing: Failed to sign bin\Release\app.publish\\setup.exe." And my problem is probably not the due to a given certificate, as the same certificate works to sign the same project from other computers, and I also get the same error when using freshly generated test certificates. I never had any problem until today, for no apparent reason. – Ama Nov 14 '20 at 22:28
  • @Ama Sorry, I don't remember. It was many years ago... – David Shochet Nov 15 '20 at 23:14

12 Answers12

229

Go to main project properties > Signing > If the expiration date is over > click on Create Test Certificate, password is not mandatory, and you're done.

Antoine Meltzheim
  • 9,579
  • 6
  • 35
  • 41
65

I'd check whether the certificate expired. Most (all?) certs have an expiration date.

Judah Gabriel Himango
  • 58,906
  • 38
  • 158
  • 212
6

I got this problem installing visual c++ on top of a VS2017 .net install. I solved it by unchecking Properties -> Security -> Enable ClickOnce security settings.

It then created an app.manifest file. After that the error went away. Interestingly enough, I checked it again to see what would happen and the problem did not come back.

SilentNot
  • 1,661
  • 1
  • 16
  • 25
5

Did you check for the certificate?

View or manage your certificates

You can use the MMC Snap In or Internet Explorer.

paparazzo
  • 44,497
  • 23
  • 105
  • 176
  • 4
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/18478108) – Vadim Martynov Jan 10 '18 at 17:17
  • @VadimMartynov The link is already dead. I will find a good link or delete. – paparazzo Jan 10 '18 at 17:20
5

Go to main project properties > Signing > Select from Store...
Click certificate properties
And install certificate

geisterfurz007
  • 5,292
  • 5
  • 33
  • 54
motodiver
  • 191
  • 1
  • 4
5

Go to Main project (Startup Project) and right click > properties Then go to Signing Then unchecked "Sign the ClickOnce manifests" It's work for me.

Nxt_N_C
  • 51
  • 1
  • 3
4

This happens mostly if your certificate for that particular project has expired or has some issues.

Right Click Project -> Properties -> Signing Tab -> More Details button -> Shows your certificate details. Check if your certificate has expired

Ways to Fix

1. Un-check the "Sign the ClickOnce manifests" and try

2. Extend the Certificate by creating a Test Certificate (If your certificate is expired)

  • Hit "Create Test Certificate..." button
  • Enter your credentials (Not mandatory)
  • Save

3. Re-validate your existing certificate (If your certificate is not expired)

  • Hit "Select from file" button and use your existing key file (eg. .pfx)

OR

  • Hit "Select from Store" button and select from the available options

Tip: If you still face issues building the project. Just restart your Visual Studio.

Hope that helps.

3

I had this same issue and I was able to solve it by removing or changing the timestamp server URL. After removing that, the project was able to build successfully.

enter image description here

Jakal
  • 62
  • 2
  • 13
  • http://timestamp.sectigo.com seem indeed to be problematic: https://stackoverflow.com/questions/62161135/signersign-failed-2146869243-0x80096005 – Ama Nov 14 '20 at 22:42
2

I just ran into the problem today. In my particular case, it was caused by this Microsoft Windows Update.

I uninstalled that update and publish began working as it always had. This is only a temporary work around and means you should probably regenerate your keys/certificates.

UnhandledExcepSean
  • 12,504
  • 2
  • 35
  • 51
1

In my case, the cert was not expired and none of the other solutions worked (restarting VS, using a temp test cert, restarting computer, etc.)

The issue was resolved by deleting my output directory and rebuilding.

0

Simple Clean sorted it for me. Build - Clean Solution

scottsanpedro
  • 1,142
  • 2
  • 12
  • 28
0

In my situation I had many projects in the solution, so I browsed to the non-startup project and:

Go to main project properties > Signing > uncheck the Sign the ClickOnce option Using Visual Studio 2019

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Nada N. Hantouli
  • 1,310
  • 1
  • 12
  • 20