Unknown Error "-2147012865" when signing a ClickOnce manifest


Recently, we came across the following issue when attempting to sign a VSTO Add-In with a code-signing certificate:

An error occurred while signing: Unknown error “-2147012865”


Any search of the error message brought up related answers but not ones specific to this particular error number. Although I can’t be sure of the error number, I believe I had seen this before when we were having network troubles and the timestamp server couldn’t be reached.

That is also what the issue was, we didn’t follow our certificate provider’s emails and changed the timestamp server to a new URL before the old one had been shut down, and as such the ClickOnce manifest couldn’t be signed.

If you also come across this issue I would suggest you check the timestamp server URL is correct, and that whatever environment you build from can connect to that server.