Problem solve Get help with specific problems with your technologies, process and projects.

I'm in COM DLL hell -- please help

I am developing an ASP.NET application that uses a COM component. I use the COM component by registering in the development machine using regsvr32, then go to add reference and, under COM tab, point to the COM component reference there. I have an issue regarding the same. Whenever I create a new version of COM DLL, I need to unregister the previous entry and restart the machine before registering the new version to make it work properly, and if I don't, I will get an error says 'Query Interface Failed' for the COM component! Is this the right way to work with the COM component, and is there any way to deal with this issue I'm having?
You're suffering the well-known DLL hell problem. When the CCW (COM Callable Wrapper) is created (when you add a reference to the COM DLL, that's what's happening), the .NET assembly that makes it up uses the COM GUID to locate the corresponding component. If you register a new version, there will be a conflict, and the CCW will no longer be able to query inside the new COM dll, because of Vtable address mismatches and all sort of incompatibilty issues that made this problem so unfortunately usual in the "old" COM days. Unless you compile the DLL with binary compatibility enabled, and use exactly the same GUID each time (and pray for it to work in the meantime), this is unavoidable.

Dig Deeper on Win Development Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.