Excel VSTO ClickOnce Installation from an Apache server throwing an error "dll.manifest, has a different computed hash than specified in manifest."

StackOverflow https://stackoverflow.com/questions/19934534

Question

First of all, I realize this question has been asked many, many times before. I've reviewed countless solutions but none of them have solved my error.

So I have a published ClickOnce Excel Add-In which will install fine when it installs from a local directory (so looking for .vsto in the same folder rather than from a website). However I want my add-in to check for updates from my server so I set up my install path to be http://[subdomain].[domain].com/exceladdin/.

I put my files in a git directory and push them to my remote repository. I then pull the changes to my Apache2 server (the "setup.exe", ".vsto" and "Application Files" folder are all in the public/exceladdin directory). I then restart my Apache2 server.

When I access .vsto from Internet Explorer it starts the installation but then breaks with the following message:

Name: 
From: http://<subdomain>.<domain>.com/exceladdin/<filename>.vsto

************** Exception Text **************
System.Deployment.Application.InvalidDeploymentException: Application manifest has   either a different computed hash than the one specified or no hash specified at all.  --->
System.Deployment.Application.InvalidDeploymentException: File, <filename>.dll.manifest, has a different computed hash than specified in manifest.
   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)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

The exact same thing happens if I download the setup.exe and run it.

The things I'm using:

  • Visual Studio 2013 for creating and publishing the Add-In

  • GitHub for my remote repository

  • Apache2 to run my server

The things I've done/tried to solve this issue:

  • Set the MIME.types according to this

  • Cleaned my build/solution and deleted the obj and bin folders and then re-published the files

  • Used Mage and MageUI to resign the manifests according to this

  • I'm also signing my Add-In with a custom test certificate

I've been trying to solve this for a good while now so any troubleshooting tips will be much appreciated!

Thanks in advance

Was it helpful?

Solution

The problem had to do with Github, it was changing my files and thus causing the hash code to mismatch.

To solve this problem I followed this tutorial and added a .gitattributes file with

*.vsto binary
*.deploy binary
*.manifest binary

To get Github to not change my files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top