none
Signing Manifest before & after Clickonce Deployment RRS feed

  • Question


  • I have a project which uses clickonce deployment built on Visual Studio .NET Framework 4.6. 
    Initially, I'm doing an unsigned publish is on a local drive, I use an encryption(Gemalto encryption) step then sign the deployment files using a self signed certificate and MageUI.exe.

    This year, there have been more than 6 deployment updates on the project and this update was supposed to be the same update process as I've done previously. 

    currently, the error that I'm getting when the software tries to update is "the files in the manifest have a different hash, can't verifyHash...


    Reading online, I have carried out different solutions suggested. however none of them are proving to help. The solutions tried are:
    1. Deleted all the files in the Project bin, rebuild the project before doing the clickonce publish. The build was fine, but come time to sign using MageUI.exe there was no success(error above occurs).
    2. Since I am currently using .NET Framework 4.6, if I use a new self signed certificate(previous cert had expired) the update process should work fine as per recommendation from this link https://msdn.microsoft.com/en-us/library/ff369721.aspx. This step as well unfortunately didn't prove to be a solution to my problem.
    3. Created a new manifest, same as the 2 deployment manifest files. That gave me an error that the Manifest was not in the right format.
    4. In Visual studio, the project properties has the option where one can sign the project just before deployment shows that "The ClickOnce manifests cannot be signed because they contain one or more references that are not hashed". I got a solution of making sure all files are included  from "Publish/Application Files..." dialog. However when doing that I could successfully install my application but the application crashes immediately. 
       


    The full details of the error are
    PLATFORM VERSION INFO
                Windows                                  : 10.0.10586.0 (Win32NT)
                Common Language Runtime     : 4.0.30319.42000
                System.Deployment.dll                         : 4.6.1078.0 built by: NETFXREL3STAGE
                clr.dll                            : 4.6.1650.0 built by: NETFXREL3STAGE
                dfdll.dll                                     : 4.6.1038.0 built by: NETFXREL2
                dfshim.dll                                 : 10.0.10586.0 (th2_release.151029-1700)

    SOURCES
                Deployment url                        : file:///C:/E%20Deploy/3.1.3.0/Publish/Prism.application
                Application url                          : file:///C:/E%20Deploy/3.1.3.0/Publish/Application%20Files/Prism_3_1_3_0/Prism.exe.manifest

    IDENTITIES
                Deployment Identity                : Prism.application, Version=3.1.3.0, Culture=neutral, PublicKeyToken=97ab91a420aeaccb, processorArchitecture=x86

    APPLICATION SUMMARY
                * Installable application.

    ERROR SUMMARY
                Below is a summary of the errors, details of these errors are listed later in the log.
                * Activation of C:\E Deploy\3.1.3.0\Publish\Prism.application resulted in exception. Following failure messages were detected:
                            + Application manifest has either a different computed hash than the one specified or no hash specified at all. 
                            + File, Prism.exe.manifest, has a different computed hash than specified in manifest.

    COMPONENT STORE TRANSACTION FAILURE SUMMARY
                No transaction error was detected.

    WARNINGS
                There were no warnings during this operation.

    OPERATION PROGRESS STATUS
                * [08/08/2017 11:21:36 AM] : Activation of C:\E Deploy\3.1.3.0\Publish\Prism.application has started.
                * [08/08/2017 11:21:36 AM] : Processing of deployment manifest has successfully completed.
                * [08/08/2017 11:21:36 AM] : Installation of the application has started.

    ERROR DETAILS
                Following errors were detected during this operation.
                * [08/08/2017 11:21:36 AM] System.Deployment.Application.InvalidDeploymentException (HashValidation)
                            - Application manifest has either a different computed hash than the one specified or no hash specified at all. 
                            - Source: System.Deployment
                            - Stack trace:
                                        at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
                                        at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
                                        at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
                                        at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
                                        at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
                            --- Inner Exception ---
                            System.Deployment.Application.InvalidDeploymentException (HashValidation)
                            - File, Prism.exe.manifest, has a different computed hash than specified in manifest.
                            - Source: System.Deployment
                            - Stack trace:
                                        at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)
                                        at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)
                                        at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)

    COMPONENT STORE TRANSACTION DETAILS
                No transaction information is available.



    is there another solution approach I could use?

    Thanks in advance
    • Edited by BensonAIS Thursday, August 10, 2017 6:45 PM
    • Moved by Bob Ding Monday, August 28, 2017 7:01 AM not wpf question
    Thursday, August 10, 2017 4:29 PM

All replies