清单可能无效,或者无法打开文件

本文关键字:文件 或者 单可能 无效 | 更新日期: 2023-09-27 18:07:07

我知道这是一个很常见的问题。但是,有一点不同,我的WPF安装得很好,可以在Windows 7和Windows 8操作系统上运行。但是,当尝试在运行Windows XP的虚拟机上安装时,它给出以下错误:

不能继续。应用程序格式不正确。 :

平台版本信息

Windows             : 5.1.2600.196608 (Win32NT)
    Common Language Runtime     : 4.0.30319.1
    System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.1 (RTMRel.030319-0100)
    dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll          : 4.0.31106.0 (Main.031106-0000)
SOURCES
    Deployment url          : file:///S:/K3FrontEnd_NET4/Karacell3.application
<<p> 错误总结/strong>

下面是错误的摘要,这些错误的详细信息将在稍后的日志中列出。

* Activation of S:'K3FrontEnd_NET4'Karacell3.application resulted in exception. Following failure messages were detected:
        + Exception reading manifest from file:///S:/K3FrontEnd_NET4/Karacell3.application: the manifest may not be valid or the file could not be opened.
        + Manifest XML signature is not valid.
        + SignatureDescription could not be created for the signature algorithm supplied.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.
WARNINGS
    There were no warnings during this operation.
OPERATION PROGRESS STATUS
    * [4/3/2013 2:58:13 PM] : Activation of S:'K3FrontEnd_NET4'Karacell3.application has started.
ERROR DETAILS
    Following errors were detected during this operation.
    * [4/3/2013 2:58:14 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
        - Exception reading manifest from file:///S:/K3FrontEnd_NET4/Karacell3.application: the manifest may not be valid or the file could not be opened.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            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 (SignatureValidation)
        - Manifest XML signature is not valid.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
            at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
        --- Inner Exception ---
        System.Security.Cryptography.CryptographicException
        - SignatureDescription could not be created for the signature algorithm supplied.
        - Source: System.Security
        - Stack trace:
            at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key)
            at System.Security.Cryptography.Xml.SignedXml.CheckSignature(AsymmetricAlgorithm key)
            at System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(AsymmetricAlgorithm& signingKey)
            at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
            at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)

COMPONENT STORE TRANSACTION DETAILS

没有交易信息。

  • 我用有效的密钥重新签名了应用程序
  • 我已经安装在多台pc上,它安装和工作正常。

请帮我列举一下这个错误的可能原因。

清单可能无效,或者无法打开文件

我能够通过删除清单的签名来解决我的问题。
如果你右键单击你的项目,然后转到属性,然后到签名选项卡;取消对ClickOnce清单的签名对程序集的签名
我不确定这在安全方面做了什么,但我的应用程序安装后,我删除了这些选项。

我也有同样的问题,只是机器没有合适的。net版本。

我找到原因了。服务器设置中的MIME类型问题。

所以,请在FTP根目录下添加.htaccess文件。

把这个写进去。

AddType application/microsoftpatch .msp
AddType application/microsoftupdate .msu 
AddType application/x-ms-application .application  
AddType application/x-ms-application .manifest  
AddType application/octet stream .deploy   
AddType application/x-ms-vsto .vsto

我以前见过一个类似的问题,由于缺少加密提供商,特定的WIndows操作系统无法"理解"或验证证书哈希的结果,在我的特殊情况下,它与使用使用v3模板生成的X509证书有关。

无法为提供的签名算法创建SignatureDescription

消息的突出显示部分与WinXP机器上的失败之前在几台机器上的成功安装相结合,表明您也遇到了类似的问题- WinXP不知道您用于签名clickonce的证书中指定的加密算法。

我不知道一个好的解决方案,你会在互联网上找到的正常建议是使用v2模板来生成X509而不是v3模板,但这并不一定是一个好的解决方案,并且超出了大多数组织的能力(特别是大多数人使用购买的证书而不是从他们自己的证书颁发机构生成的证书)。

您是否在windows XP机器上安装了SP-3,并安装了所有可用的windows更新?微软会周期性地对证书、可信发布者和其他相关信息的代码进行更新。

这是因为您的开发机器安装了。net 4.5,而您的客户端机器只安装了。net 4.0。. net 4.0客户端机器不能读取清单,因为它们期望SHA-1,而. net 4.5开发机器可以。

在app.manifest中注释出vista条目

    <application>
      <!-- A list of all Windows versions that this application is designed to work with. 
      Windows will automatically select the most compatible environment.-->
      <!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
      <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      <!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
      <!--The ID below indicates application support for Windows 8.1 -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
      
      <!--The ID below indicates application support for Windows 10 -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
    </application>

我在使用Visual Studio 2012构建的WinForms应用程序中遇到了同样的问题,该应用程序部署在具有所有关键更新(安装了SP3和Windows Installer 4.5)的XP机器上。我也不得不改变我的应用程序,通过去[签名]选项卡在我的项目的属性页上取消签名。我都没有检查:[签署Click One清单]和[签署程序集]。在启用了签名功能的Windows 7机器上可以很好地安装相同的应用程序

我也有类似的问题,几乎一样。我通过删除不在应用程序文件根目录中的.dll解决了一个问题。

Visual studio 2019:右键单击项目名称-属性-发布-应用程序文件。

就像这篇文章:https://social.msdn.microsoft.com/forums/en - us/3d0c4382 - 4 - d28 - 9 - 9 - b48 b79 - 25607 - e668074/problem -安装- clickonce -后-添加- reportviewercontrol - 14 - - - project?forum=winformssetup

相关文章: