clickoncecode-signingdigicert

Cannot sign ClickOnce MSWord plugin application with Cloud DigiCert certificate


I'm trying to sign a simple ClickOnce application (MSWord plugin) with a code-sign certificate from DigiCert. Last year, we use a USB-Token certificate and it worked fine, but this year we bought a cloud certificate (to allow unassisted signing on builder servers) and now we cannot sign the ClickOnce application. It throws the following exception depending on the user who executes (administrator installed certificate for all users, but perhaps it lacks something):

enter image description here

We can sign exe's and other files separately using DigiCert tool, but not the clickonce application as it would be expected to be downloaded and executed remotely confidently. We have tried to sign it by console using

We've opened a ticket in digicert, but we've no response yet.

Is there any way to fix the error (we've tried in VS2017 and VS2022)? Or how we could sign manually the clickonce application after build without signing info, using DigiCert tool?


Solution

  • After looking more carefully at the error in the Output window log, I noticed that the problem was in the Visual Studio Tools for Office targets file (using the VS2017 version).

    To investigate further, I created a new empty project using the C# Word Add-in template in VS2022, and it worked fine. I then compared both projects and, after merging the references and bootstrapper packages, the project was successfully published!

    I tried to do the same in VS2017. The empty project worked fine there as well, but when I attempted to merge it with my main project, it didn’t work. I haven’t spent more time investigating this issue, as the solution works in VS2022, which is sufficient for me.