ClickOnce Manifest具有无效的子项 - 但xml匹配旧的已发布的清单

时间:2014-11-24 13:48:09

标签: c# wpf visual-studio-2012 clickonce manifest

在我的应用安装更新或全新安装ClickOnce发布时出错。

这种情况发生在未安装应用程序的计算机上以及已安装应用程序的计算机上。我用于签署项目的pfx文件与以前的版本相同,所以我认为证书不是问题。

+ Exception reading manifest from <APPPATH>.exe.manifest: the manifest may not be valid or the file could not be opened.
+ The element 'assembly' in namespace 'urn:schemas-microsoft-com:asm.v1' has invalid child element 'SignedInfo' in namespace 'http://www.w3.org/2000/09/xmldsig#'. 
List of possible elements expected: 'dependency' in namespace 'urn:schemas-microsoft-com:asm.v1' 
as well as 'dependency' in namespace 'urn:schemas-microsoft-com:asm.v2' 
as well as 'file' in namespace 'urn:schemas-microsoft-com:asm.v1' 
as well as 'file, configuration, deployment, entryPoint, trustInfo, licensing, migration' in namespace 'urn:schemas-microsoft-com:asm.v2' 
as well as 'clrClass' in namespace 'urn:schemas-microsoft-com:asm.v1' 
as well as 'clrClass' in namespace 'urn:schemas-microsoft-com:asm.v2' 
as well as 'clrSurrogate' in namespace 'urn:schemas-microsoft-com:asm.v1' 
as well as 'clrSurrogate' in namespace 'urn:schemas-microsoft-com:asm.v2' 
as well as 'comInterfaceExternalProxyStub' in namespace 'urn:schemas-microsoft-com:asm.v1' 
as well as 'comInterfaceExternalProxyStub, KeyInfo' in namespace 'urn:schemas-microsoft-com:asm.v2' 
as well as 'Signature' in namespace 'http://www.w3.org/2000/09/xmldsig#' 
as well as any element in namespace 'urn:schemas-microsoft-com:asm.v3' 
as well as 'publisherIdentity' in namespace 'urn:schemas-micr....

没有不合适的xml元素或属性,因为将它与旧的发布进行比较可以显示元素没有区别。

有什么建议吗?

3 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,它是由显式嵌入的app.manifest

中的一个部分引起的
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
  <!-- A list of the Windows versions that this application has been tested on and is
       is designed to work with. Uncomment the appropriate elements and Windows will 
       automatically selected the most compatible environment. -->
  <!-- Windows Vista -->
  <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
  <!-- Windows 7 -->
  <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
  <!-- Windows 8 -->
  <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
  <!-- Windows 8.1 -->
  <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
  <!-- Windows 10 -->
  <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>

删除此部分(不需要)使点击一次应用程序正常工作。

答案 1 :(得分:0)

请参阅Zoom's comment,从兼容性列表(在应用清单中)中删除Vista作为受支持的操作系统即可解决此问题。

答案 2 :(得分:-1)

clickonce有它自己的头痛。特别是如果您对清单进行任何更改。什么证明了我是最好的工作流程,当对清单进行更改,转向VS然后启动它,清理项目,构建,重新启动VS,清理重建。 发布新的clickonce包后,请勿更改该文件夹中的任何内容。不要添加,删除或更新任何内容。一旦你更改了文件夹中的任何内容,它就会停止工作。