Duplicate lines being generated in .manifest file

你。 提交于 2019-12-05 14:05:45

I see it. What is not clear from the question is that this goes wrong when the Click-Once publisher rewrites your manifest and adds the click-once specific goo.

I poked at a workaround for a while, there is more than one way to do this. You can for example keep the component manifest separate and use <dependency> in the main manifest. Made no difference. The documented schema for the <file> element in a Click-Once manifest is very strange, note how it declares comInterfaceExternalProxyStub as a child of file. Moving it to match the schema did not work, it causes the element to disappear completely. This documentation is just flat-out wrong, a harbinger of trouble.

Long story short, this is a bug. It is not a strange bug, the application manifest documentation is excessively poor and especially so for comInterfaceExternalProxyStub. The several times I used Junfeng Zhang's name it was in a sentence with words I cannot repeat here.

You can report it at connect.microsoft.com. No previous reports for this, oddly, but surely most programmers either did not need it or did not try or gave up quickly and asked the user to install the COM component as a prerequisite. That is quite normal and perhaps the approach you should take as well. Other than that, editing the manifest by hand and deleting the extra lines is a workaround.

And don't forget to try to the most obvious workaround, comInterfaceExternalProxyStub is not often needed and won't be generated when you use the Isolated property in the assembly reference. The way the vast majority of programmers do it and the advice I gave you earlier. As long as you don't use the COM component from a worker thread then the proxy is not needed.

If you're happy with that solution, you should be able to prevent Visual Studio from generating a manifest file automatically:

However it is possible to disable generation of the manifest for a project using the Generate Manifest property of the project. When this property is set to Yes, the manifest for this project is generated. Otherwise the linker ignores assembly information when resolving dependencies of the application code, and does not generate the manifest.

Source (MSDN)

If that doesn't work (as you seem to suggest) you might try to change your tags. Comparing the generated "empty" tags and your tags reveals that yours are missing the numMethods attribute. (diff)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!