c# - "Manifest XML signature is not valid"

标签 c# deployment visual-studio-2012 xml-signature

操作系统:Windows 7 64 位,使用安装了 .NET 4.5 的 Visual Studio Pro 2012。

我在 Visual Studios 中使用了 Publish 选项,并确保我已单击 Sign the clickOnce manifest 和 Sign the Assembly。它仍然不会在另一台计算机上运行,​​并说我没有有效的 XML 签名。我已粘贴下面的错误消息。

我也读过:How to move a ClickOnce deployment package , Do I have to sign my ClickOnce manifest? . VS2012 .NET 4.0 Clickonce VSTO CryptographicException: SignatureDescription could not be created for the signature algorithm supplied和其他几个。

我至少需要能够在 .NET 4.0 上部署我的程序,而且我无法访问其他版本的 Visual Studio。提前致谢!

完整的错误如下:

平台版本信息
视窗:5.1.2600.196608 (Win32NT)
公共(public)语言运行时:2.0.50727.3603
System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000)
mscorwks.dll : 2.0.50727.3603 (GDR.050727-3600)
dfdll.dll : 2.0.50727.3053 (netfxsp.050727-3000)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)

来源
部署网址:file:///C:/Documents%20and%20Settings/Administrator/Desktop/EatonWizard.application

错误总结
下面是错误的摘要,这些错误的详细信息在日志后面列出。
* 激活 C:\Documents and Settings\Administrator\Desktop\EatonWizard.application 导致异常。检测到以下失败消息:
+ 从 file:///C:/Documents%20and%20Settings/Administrator/Desktop/EatonWizard.application 读取 list 的异常: list 可能无效或无法打开文件。
+ list XML 签名无效。
+ 无法为提供的签名算法创建 SignatureDescription。

组件商店交易失败总结
没有检测到交易错误。

警告
在此操作期间没有警告。

操作进度状态
* [10/10/2012 2:05:02 PM] : C:\Documents and Settings\Administrator\Desktop\EatonWizard.application 的激活已经开始。

错误详情
在此操作期间检测到以下错误。
* [10/10/2012 2:05:02 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- 从 file:///C:/Documents%20and%20Settings/Administrator/Desktop/EatonWizard.application 读取 list 时出现异常: list 可能无效或无法打开文件。
- 来源:System.Deployment
- 堆栈跟踪:
在 System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
在 System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification 通知, DownloadOptions 选项, ServerInformation& serverInformation)
在 System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification 通知, DownloadOptions 选项)
在 System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
在 System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(对象状态)
--- 内部异常 ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- list XML 签名无效。
- 来源:System.Deployment
- 堆栈跟踪:
在 System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
在 System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- 内部异常 ---
System.Security.Cryptography.CryptographicException
- 无法为提供的签名算法创建 SignatureDescription。
- 来源:System.Security
- 堆栈跟踪:
在 System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(非对称算法 key )
在 System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(AsymmetricAlgorithm&signingKey)
在 System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
在 System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)

组件商店交易详情
没有可用的交易信息。

最佳答案

我今天遇到了同样的问题。我是这样解决的:

导致问题的原因:
我们使用 vs2012 和框架 4.5 创建了一个 clickonce 项目。
然后我们将目标框架更改为 4.0(客户端要求)。

问题是:Framework 4.5 使用 SHA-256 算法进行签名,4.0 使用 SHA-1。当我们将目标框架更改为4.0并且vs2012没有更改算法时。

解决方案:手动更改算法,生成新证书。

转到项目属性-> 签名

您将看到“签名算法”中使用的算法。您可以创建一个新的测试证书,然后您会注意到它更改为“sha1RSA”

关于c# - "Manifest XML signature is not valid",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12826798/

相关文章:

sql - 无法从 VS 2012 找到 SQL Server 的 dll

c# - 在公共(public)字段上加入 C# 中的两个列表的最有效方法是什么?

c# - MVC 中用于分页的映射路由

c# - 写入二进制多字节数组消息(大端)(.Net C#)

deployment - JavaFX native bundle exe 抛出 "JavaFx launcher Exception",可执行 Jar 文件完美运行

c# - Visual Studio 2012 和 MVC 4 : How to deploy individual files/folders to filesystem?

visual-studio-2012 - 有没有办法获取 Visual Studio 使用的构建命令行?

c# - 在 silverlight 项目中引用 asp.net c# 类/方法

c# - 如何在 Visual Studio 2010 中使用我的安装和部署项目部署 SQL 服务器数据库?

unit-testing - Test.Context.BeginTimer 在 vs 212 中不起作用