Excel VSTO ClickOnce 从 Apache 服务器安装引发错误"dll.manifest, has a different computed hash than specified i



首先,我意识到这个问题以前已经被问过很多很多次了。我已经审查了无数的解决方案,但没有一个能解决我的错误。

所以我有一个已发布的 ClickOnce Excel 加载项,当它从本地目录安装时,它会安装正常(因此在同一文件夹中而不是从网站中查找 .vsto)。但是,我希望我的加载项检查来自我的服务器的更新,因此我将安装路径设置为 http://[子域]。[domain].com/exceladdin/.

我将文件放在 git 目录中并将它们推送到我的远程存储库。然后,我将更改提取到我的 Apache2 服务器("setup.exe"、".vsto"和"应用程序文件"文件夹都在 public/exceladdin 目录中)。然后我重新启动我的 Apache2 服务器。

当我从Internet Explorer访问.vsto时,它会开始安装,但随后中断并显示以下消息:

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()

如果我下载安装程序.exe并运行它,也会发生完全相同的事情。

我正在使用的东西:

  • 用于创建和发布外接程序的 Visual Studio 2013

  • 我的远程仓库的 GitHub

  • Apache2 运行我的服务器

我做过/试图解决这个问题的事情:

  • 根据此设置 MIME.类型

  • 清理了我的构建/解决方案并删除了 obj 和 bin 文件夹,然后重新发布了文件

  • 使用法师
  • 和法师UI根据此辞职清单

  • 我还使用自定义测试证书对外接程序进行签名

我一直在尝试解决这个问题很长一段时间,所以任何故障排除技巧将不胜感激!

提前致谢

问题与 Github 有关,它正在更改我的文件,从而导致哈希代码不匹配。

为了解决这个问题,我按照本教程添加了一个 .gitattributes 文件

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

让 Github 不更改我的文件。

相关内容

最新更新