Change Target CPU of ClickOnce Application - Error


  • Hi All,

    When I change the target CPU of my clickonce application from "Any CPU" to "x86" in Advanced compile options of the project properties, and publish the latest version to a shared location, I get a pop up message saying "The applicatin platform does not match the existing application on the server. Do you want to overwrite it." with Yes and No options. When I say Yes then the app is successfully published to the shared location. But when I start the app (auto update clickonce), it gives a message "The application cannot be started". The error details are as given below.

    - System.Deployment.Application.DeploymentException (SubscriptionState)
            - The deployment identity does not match the subscription.
            - Source: System.Deployment
            - Stack trace:
                at System.Deployment.Application.SubscriptionStore.CheckUpdateInManifest(SubscriptionState subState, AssemblyManifest deployment, Version currentVersion)
                at System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState subState)
                at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, TempFile& deployFile)
                at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
                at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)


    To get the application working, I had to uninstall the application and install the latest version. Is there a way to prevent the unistall and install, on changing the target CPU of a clickonce application.

    Thanks in advance

    Wednesday, December 19, 2007 11:32 AM


  • Dan,

    There is nothing you can do about this. If you change one of the parameters that is used to identify the deployment, your users have to uninstall and reinstall the application.

    Ts'i mahnu uterna ot twan ot geifur hingts uto.
    Thursday, March 05, 2009 8:09 AM

All replies


    Hi Shiva3Al!3n,

    I cannot reproduce you problem. Could you please provide more details (e.g. Visual Studio 2005 or 2008) about this problem? There is another thread talk about changing Target CPU of ClickOnce Application. And it may help you solve this problem.


    As the error said it is the deployment identity which causes the problem, this error shows that you may update the application with a different deployment identity. The most probable reason would be that you might publish the application with a different certificate which changes the publicKeyToken. Please compare the .application file from new version with the old one to verify that publicKeyToken value is the same.

    Hope this helps.
    Best regards.
    Rong-Chun Zhang

    Monday, December 24, 2007 6:53 AM
  • Hi Rong-Chun Zhang,

    Thank you for your reply..
    The thread you referred couldn't solve my problem. I suppose that it talks about the first publish.

    I am using Visual Studio 2005. The actual problem I am facing is that the previous version of the application are published with target CPU set = "Any CPU". In my latest version, I am referring a COM DLL. Publish and auto update of the click once app was not a problem. But when the users perform operations that refer this dll, they get a error like "retrieving the com class factory for component with CLSID {.....} failed due to error:80040154". The solution to this problem as I found on the net was to publish the application with target CPU="X86". I published it to a different test location and tested it, and the COM problem was solved.

    Now I can publish the app with target CPU="X86", to the production location, but all the users will have to uninstall the old version and install the new version. All users uninstalling and reinstalling the latest version is not feasible.

    I have used the same certificate to sign the previous version. I don't think this is a certificate problem (I have read about the certificate expiration problems). And the publicKeyToken is the same for both the previous and the latest versions.

    The link( says that the error "The deployment identity does not match the subscription" is displayed when the name, processorArchitecture, or publicKeyToken of the latest version of the  click once application is different from that of the previous version.

    Please let me know if there is way to avoid the uninstall and reinstall of the app, when the target CPU is changed from "Any CPU" to "X86". And if the "retrieving the com class factory for component with CLSID {.....} failed due to error:80040154" be solved without changing the target platform.


    Thursday, December 27, 2007 12:02 PM
  • Shiva,

    I know this is an old thread, but hopefully you're subscribed to replies...

    Did you find a solution to this problem? Same thing for me: I changed my target platform from "Any CPU" to "x86" and now users must uninstall and reinstall the ClickOnce application. Can't find any working solutions online.

    Wednesday, March 04, 2009 7:23 PM
  • Dan,

    There is nothing you can do about this. If you change one of the parameters that is used to identify the deployment, your users have to uninstall and reinstall the application.

    Ts'i mahnu uterna ot twan ot geifur hingts uto.
    Thursday, March 05, 2009 8:09 AM
  • I'm hoping there is a better work around years later. I have changed my target cpu from Any CPU to x86. This was needed because part of the clickonce application runs customer code that uses OleDbConnections. I am looking for an alternate to using the OleDbConnection/workaround for using it on Windows 7,  or a workaround to publishing a clickonce application whose build option was changed. This is the error I get when trying to run clickonce after redeploying the x86 build

    The deployment identity does not match the subscription.


    Any help is GREATLY appreciated!!!

    Thursday, July 29, 2010 4:03 PM
  • Sorry, but no change. This is part of the identity of the application, and if changed, the application is no longer recognized as an update to the earlier installation.

    You can always programmatically uninstall that version and install a new one so the user doesn't have to figure out how to use the Control Panel.


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Friday, July 30, 2010 6:00 AM
  • A few months later, but I had this same problem.  Changed my target CPU on the deployment.  I remember doing some test work with deploying to very specific target CPU's and must have never changed it back.  The state of this setting before any test work was "All" and I had changed it to X86.  Simply changed it back to "All" and my problem was solved.

    I appreciate this post.  That would have been a long night.


    Monday, October 11, 2010 3:12 PM