Reputation: 157
I publish my exe and activate auto updates.
But when I compile the exe, there is an error:
Severity Code Description Project File Line Suppression State Error An error occurred while signing: Failed to sign bin\Debug\app.publish\myapp.exe. SignTool Error: Invalid option: /fd
So I couldn't publish.
When I try to uncheck "Sign the ClickOnce manifest" the error is gone but I couldn't install the package because Windows doesn't allow and the Windows Defender SmartScreen blocks my app because there's no certificate.
I have to add a certificate from "Sign the ClickOnce manifest" but now it gives the "SignTool Error: Invalid option: /fd" error.
How can I solve this problem?
Upvotes: 8
Views: 11537
Reputation: 842
I encountered the same error message when migrating an old ClickOnce project from VS2008 to VS2017. It seems my VS2008 was using an old version of SignTool.
I found (and succeeded with) a tip to change registry key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows
to make Windows to use newer SDK (in my situation SDK v8.1A was the most recent).
The original tip can be found here: https://social.msdn.microsoft.com/Forums/en-US/a39b9f82-aaec-4bbd-8cb2-3cade50796ba/an-error-occurred-while-signing-failed-to-sign-bindebugapppublishprogramexe-signtool-error (scroll down to answer by nikidimi)
Upvotes: 3
Reputation: 21
Go to the myapp.csproj file, which is the project file, and search for 'SignManifests' PropertyGroup, change the value to false, and the error disappears. This worked for me.
Upvotes: 2
Reputation: 71
I did just the opposite as Stefano - changed it from sha256RSA to sha1RSA - and then it allowed me to publish without the error.
Just changing the signature algorithm may do the trick.
Upvotes: 6
Reputation: 107
I had to change the Signature Algorithm to sha1RSA from sha256RSA
Upvotes: 6