单击“应用程序格式不正确”当更改 COM 引用“隔离”时财产
使用 ClickOnce 部署我的应用程序。
只要我部署到开发计算机,通过 ClickOnce 发布应用程序就可以正常工作。当我部署到非开发计算机(缺少一些 DLL 和注册)时,我收到 COM 引用错误。
因此,为了解决 COM 问题,当我对应用程序进行这一更改时,ClickOnce 会更加失败:
在一个 COM 引用上,如果我将isolated属性从 false 更改为 true...
- ClickOnce 发布得很好,
- 启动应用程序显示此错误:“无法继续。应用程序格式不正确。”
- 如果我单击错误上的“详细信息...”,我会看到:“‘threadingModel’属性无效 - 值“公寓”无效根据其数据类型 'urn:schemas-microsoft-com:asm.v1:ThreadingModelType' - 枚举约束失败。”
经过一番谷歌搜索后,似乎问题可能是字符大小写问题!我尝试将清单中的“公寓”更改为“公寓”,我相信这可以解决问题,但随后我收到另一个错误,指出清单上计算的哈希值与预期的哈希值不匹配(显然是因为我修改了清单) )。
我的问题:
- 首先,如何确保 ClickOnce 创建格式正确的清单而不会出现这种情况问题(如果这就是问题所在)?这可以避免吗?
- 其次,如果我必须忍受这个问题,发布后如何修改清单?
- 第三,有没有办法在不修改Isolated属性的情况下解决ClickOnce的COM注册问题?
- 第四,您是否怀疑我在导致此问题的线程方面做了一些奇怪/不寻常的事情?
Using ClickOnce for the deployment of my application.
Publishing the app via ClickOnce works fine, as long as I am deploying to a development machine. When I deploy to a non-development machine (missing some DLL's and registrations), I get a COM reference error.
So, to solve the COM issue, when I make this one change to my application, ClickOnce fails even more spectacularly:
On one COM reference, if I change the Isolated property from false to true...
- ClickOnce publishes just fine
- Launching the app shows this error: "Cannot continue. The application is improperly formatted."
- If I click "Details..." on the error I see: "The 'threadingModel' attribute is invalid - The value 'apartment' is invalid according to its datatype 'urn:schemas-microsoft-com:asm.v1:ThreadingModelType' - The Enumeration constraint failed."
After some Googling, it seems that the problem may be a character case issue! I tried changing "apartment" to "Apartment" in the manifest, which I believe may solve the issue, but then I get another error stating that the computed hash on the manifest doesn't match the expected hash (obviously because I modified the manifest).
My questions:
- First, how can I ensure that ClickOnce creates properly formed manifests without this case issue (if this is the problem all together)? Can this be avoided?
- Secondly, if I have to live with this issue, how can I modify the manifests after publishing?
- Third, are there ways of solving this COM registration issue for ClickOnce without modifying the Isolated property?
- Fourth, do you suspect I am doing something strange / out of the ordinary with respect to threading that causes this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论