开发者

Clickonce "The application is improperly formatted" when changing COM reference "Isolated" property

开发者 https://www.devze.com 2023-04-01 10:46 出处:网络
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 开发者_如何学Ca non-development

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 开发者_如何学Ca 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?
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号