none
Can't update application when new version uses new certificate RRS feed

  • Question

  • I develop a WinForms application that I publish to a web location using ClickOnce. I've been signing my ClickOnce manifest with a certificate I purchased about a year ago. Since it's about to expire, I purchased a new one, replaced the certificate with the new one and published an update. The problem is, I don't get any update prompt the second time I launch the application. And if I manually install the updated version (by downloading and running setup.exe), it will be installed side-by-side with the old version (with a "- 1" appended to the application name). So it seems that Windows thinks this is a fully different application.

    According to this article, I should be able to change the certificate without any trouble (since this is a WinForms application targeting .NET Framework 4.6.2 made in Visual Studio 2017), unless some bug was re-introduced.

    One thing I've noted is that when I compare my published manifest files, they both have a different publicKeyToken in the assemblyIdentity element, and this only occurs when the versions being compared have different certificates. So I wonder if this is why Windows thinks this is a different application. I've also noted that there are a few differences in the publisherIdentity element: the PostalCode and the issuerKeyHash attributes are different, which again is not the case when I compare versions that use the same certificate.

    So I realized that I accidentally entered different zip codes when I purchased each certificate, and I wonder if this could be the cause of the issue. I really wasn't paying much attention since I specifically asked support to use the exact same data as the previous certificate. Anyway, I could just purchase yet another certificate, but don't want to spend money again before I'm sure that the postal code difference is the cause of the problem, so I wonder if a more experienced person could clarify this for me. Also, the article I linked above doesn't mention anything about old and new certificates having to have the exact same issuer information so I'm hesitant about purchasing a new certificate just to see if that fixes it. Is the problem here the postal code difference, or is this just the way ClickOnce works and users will have to uninstall and re-install my application. and then do this each time a new certificate is used? 

     




    • Edited by jls Wednesday, November 6, 2019 5:10 AM
    Wednesday, November 6, 2019 5:07 AM

All replies

  • Hi jls,

    To achieve your requirement, you can try the following steps.

    1. Uninstall your ClickOnce application from the control panel.

    2. Delete all files under the ClickOnce application installation path.
        Installation path: C:\ Users\username\ AppData\Local\ Apps\ 2.0 .... 

    3. Republish the ClickOnce application.

    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, November 6, 2019 8:12 AM
  • Thanks Daniel, but I guess I wasn't clear. If it was just me, I could just uninstall and reinstall. There's no need to clear the 2.0 folder or re-publish. But this is a commercial product that has many users and the point of my question was to avoid having to tell all my users to uninstall (let alone clear the 2.0 folder) in order to update the application, and do this  every I change my certificate. Which is why I need to know why Windows is considering my updated version to be a separate application.

    Or did you mean that if I clear the 2.0 folder and re-publish from my machine, then my users in their machines will be able to update normally for some weird reason?



    • Edited by jls Wednesday, November 6, 2019 7:00 PM
    Wednesday, November 6, 2019 2:53 PM
  • Hi jls,

    This problem may be caused by the cache. After clearing the cache and republishing it, you will get a new application with an updated certificate. 

    Best Regard,

    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Thursday, November 7, 2019 7:12 AM
  • Do you mean clear the cache on the machine where I compile and build the application, or the machine where I'll install it? 
    • Edited by jls Thursday, November 7, 2019 8:16 PM
    Thursday, November 7, 2019 8:15 PM
  • Hi jls,

    Clear the cache on the machine where you'll install it.

    Best Regards,

    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, November 8, 2019 2:36 AM
  • Hi Daniel,

    Thanks, but that doesn't solve my problem at all. As I mentioned before, uninstalling my application and then reinstalling it will get them the updated version. But the point of my question is to avoid this because, among other things, the application settings will be gone. Clearing the 2.0 folder will also uninstall my application and clear all settings, so is no different than what I'm trying to avoid, except for the fact that it's actually worse, since it will also uninstall every other ClickOnce application that they may have installed, including settings and configuration files that may contain important data.


    Friday, November 8, 2019 3:04 AM