ClickOnce 错误:清单身份包含一个或多个无效字符
我正在尝试使用第三方程序集部署 .NET 3.5 应用程序。我可以毫无问题地创建 ClickOnce 安装程序。但是,当我尝试运行安装程序时,我收到以下消息:
无法启动应用程序:无法继续。该应用程序的格式不正确。请联系应用程序供应商寻求帮助。
以下是错误日志的重要部分:
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of <my application path>.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from file <my application path>.exe.manifest: the manifest may not be valid or the file could not be opened.
+ Application manifest is not semantically valid.
+ Manifest identity has one or more invalid characters: ABISFoundationSDK_C#.
如您所见,SDK 身份名称中包含井号 (#)。有没有办法可以更改 SDK 程序集的标识以删除井号?第三方提供商不太可能对程序集进行此更改。
I am trying to deploy a .NET 3.5 application using a third-party assembly. I can create the ClickOnce setup program with no problems. When I try to run setup, however, I get this message:
Cannot Start Application: Cannot continue. The application is improperly formatted. Contact the application vendor for assistance.
Here is the important part of the error log:
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of <my application path>.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from file <my application path>.exe.manifest: the manifest may not be valid or the file could not be opened.
+ Application manifest is not semantically valid.
+ Manifest identity has one or more invalid characters: ABISFoundationSDK_C#.
As you can see, the SDK identity name has a pound (#) sign in it. Is there a way that I can change the identity of the SDK assembly to remove the pound sign? It is unlikely that the third-party provider will make this change to the assembly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是如何将 dll 添加到部署中的?您刚刚添加它并编辑清单吗?
在部署中包含第 3 方程序集的最佳方法是:
将程序集添加到项目中。将构建操作设置为“无”并将“复制到输出目录”设置为“不复制”。然后删除对该程序集的引用。重新添加引用并指向项目中的本地副本;在引用属性上将“复制本地”设置为“true”。
如果您没有直接引用项目中的程序集,请将其添加到项目中并将生成操作设置为“内容”,将“复制到输出目录”设置为“始终复制”。
如果真正导致您问题的是 octothorpe,您可以重命名它吗?程序集名称中实际上有 # 吗?
How did you add the dll to the deployment? Did you just add it and edit the manifest?
The best way to include a 3rd party assembly with your deployment is this:
Add the assembly to your project. Set the build action to 'none' and set "copy to output directory" to "do not copy". Then delete the reference you have to that assembly. Re-add the reference and point to that local copy in your project; set "copy local" to "true" on the reference properties.
If you don't have a direct reference to the assembly in your project, add it to your project and set the build action to "content" and "copy to output directory" to "copy always".
If it is the octothorpe that is really causing your problem, can you rename it? Does it actually have the # in the name of the assembly?