开发者

How to debug registry free COM?

开发者 https://www.devze.com 2023-03-17 00:40 出处:网络
I have a messy situation wrapping a couple of 3rd party COM components. Actually it\'s one COM component and several .NET assemblies. The .NET assemblies in turn depend on the same 3rd party\'s intern

I have a messy situation wrapping a couple of 3rd party COM components. Actually it's one COM component and several .NET assemblies. The .NET assemblies in turn depend on the same 3rd party's internal COM component. When I have the COM DLLs registered, my code works fine (right now I'm testing from C#). When I don't, it fails. What's the best way to debug that?

I generated the SxS manifest by adding a reference to the COM components, setting Isolated=true, then extracting the resulting comClass elements from the manifest into my own SxS manifest. Also, it seems to create an Interop.XXX.dll file: what is that for?

Some example error messages:

"Retrieving the COM class factory for component with CLSID {012A4BEB-99EC-4A65-A4AF-7D09A20B5034} failed due to the following error: 80040154."

"HSREADWRITELib::ReadWriteData, CreateInsta开发者_运维技巧nce"


This is the most basic failure you can get from reg-free COM, it is not using the manifest or the manifest is incorrect. Verify that your manifest has a <file> element that names the COM DLL and contains a <comClass> element with a "clsid" attribute that has the same guid as the one that the exception message is complaining about.

Then make sure that the manifest is embedded in the client executable. You can see it with File + Open + File in Visual Studio, open the RT_MANIFEST node.

0

精彩评论

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

关注公众号