VS2012 .NET 4.0 Clickonce VSTO CryptographicException:无法为提供的签名算法创建 SignatureDescription [英] VS2012 .NET 4.0 Clickonce VSTO CryptographicException: SignatureDescription could not be created for the signature algorithm supplied

查看:37
本文介绍了VS2012 .NET 4.0 Clickonce VSTO CryptographicException:无法为提供的签名算法创建 SignatureDescription的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 VS2010 .NET 4.0 VSTO Outlook Addin 项目,我希望将其迁移到 VS2012(但将其保留在 .NET 4.0 中).它编译得很好,并且从 IDE 内部运行也很好,但是当我尝试运行已发布的 ClickOnce 安装程序时,出现以下异常:

I have a VS2010 .NET 4.0 VSTO Outlook Addin project that I wish to migrate to VS2012 (but keep it in .NET 4.0). It compiles fine, and runs from inside the IDE just fine, but when I attempt to run the published ClickOnce installer, I get the following exception:

System.Deployment.Application.InvalidDeploymentException:异常从 file://MyPath/MyAddIn.vsto 读取清单:清单可能不会有效或无法打开文件.---> System.Deployment.Application.InvalidDeploymentException:清单 XML 签名无效.---> System.Security.Cryptography.CryptographicException:无法为签名算法创建 SignatureDescription提供.

System.Deployment.Application.InvalidDeploymentException: Exception reading manifest from file://MyPath/MyAddIn.vsto: the manifest may not be valid or the file could not be opened. ---> System.Deployment.Application.InvalidDeploymentException: Manifest XML signature is not valid. ---> System.Security.Cryptography.CryptographicException: SignatureDescription could not be created for the signature algorithm supplied.

基于我的测试和在线研究(此处 那里),看来只是在我的机器上安装了 VS2012(无论我是从 VS2010 还是 VS2012 发布)强制 ClickOnce 安装程序在使用 .NET 4.0 时要求一个 SHA1 证书.我现有的 SHA256 证书在使用 VS2010 编译时与 .NET 4.0 完美配合(未安装 VS2012).

Based on my tests and online research (here and there), it appears that just having VS2012 installed on my machine (whether I publish from VS2010 or VS2012) forces the ClickOnce installer to require a SHA1 certificate when using .NET 4.0. My existing SHA256 certificate works perfectly fine with .NET 4.0 when compiled using VS2010 (without VS2012 installed).

  • 我无法将客户端升级到 .NET 4.5,因为这是一个 VSTO40 项目(在 XP/Office 2007 上运行).
  • 我无法在本地机器上卸载 VS2012/.NET 4.5,因为我有其他需要它的项目.
  • 我无法轻松将我的证书从 SHA256 降级到 SHA1.
  • I can't upgrade clients to .NET 4.5 because this is a VSTO40 project (runs on XP/Office 2007).
  • I can't uninstall VS2012/.NET 4.5 on local machine because I have other projects that need it.
  • I can't easily downgrade my certificate from SHA256 to SHA1.

还有其他建议可以让我继续前进吗?

Are there any other suggestions to allow me to move forward?

推荐答案

我通过创建一个新证书解决了我的问题,该证书用于签署 ClickOnce 清单并使用 SHA1 算法生成它.您可以在此处查看对话:http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/eba424ae-f7b7-4530-bb68-db3b9972a31e

I solved my problem by creating a new certificate that is used to sign the ClickOnce manifest and generated it using the SHA1 algorithm. You can see the conversation here: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/eba424ae-f7b7-4530-bb68-db3b9972a31e

编辑 2014 年 8 月 5 日:
Visual Studio 2013 Update 3 终于解决了这个问题.
http://support.microsoft.com/kb/2933779
已修复问题 -> 常规:

您甚至可以为应用程序使用 SHA 256 代码签名证书面向 .NET Framework 4.0 或更早版本.在这之前更新,客户端上必须存在 .NET Framework 4.5当 SHA 256 代码签名证书用于桌面时的计算机使用 ClickOnce 或 Visual Studio 工具发布的应用程序办公室插件.如果您使用了 SHA 256 代码签名证书过去,并且看到过诸如应用程序不正确已格式化"、清单可能无效"、清单 XML 签名"无效"或无法为签名算法提供,此更新解决了问题重新发布和新发布的应用程序.

You can use SHA 256 code-signing certificates even for applications that target the .NET Framework 4.0 or an earlier version. Before this update, the .NET Framework 4.5 had to be present on the client computer when a SHA 256 code-signing certificate was used for desktop applications published with ClickOnce or Visual Studio Tools for Office add-ins. If you have used SHA 256 code-signing certificates in the past, and have seen errors such as "The application is improperly formatted," "The manifest may not be valid," "Manifest XML signature is not valid," or "SignatureDescription could not be created for the signature algorithm supplied," this update resolves the problem for re-published and newly-published applications.

这篇关于VS2012 .NET 4.0 Clickonce VSTO CryptographicException:无法为提供的签名算法创建 SignatureDescription的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆