Search code examples
c#asp.net.netcomcom+

Few queries to understand com+ registrations


I have to work on some legacy asp.net web form project which uses com dll for some of it's method invocation.

As I have never worked with com dll, hence got few questions, but not getting clear enough answers to it. If you can answer these, it will help a lot to understand their way of working.

  1. What register does

when we register some dll as com dll(post which it shows up in component services), then will there be a copy of dll made and kept somewhere by windows or that component always points to same path of dll which was registered.

  1. What happens if i delete dll post registration, will registered com component still work?

  2. what about dependent dlls, so suppose i registered some abc.dll which is dependent on xyz.dll(not com dll), when i registered abc.dll from a path, that was having xyz.dll as well in same path, so post registration when my client app needing abc.dll as com component invokes it, then will abc.dll look for xyz.dll in my application's bin or will it look at same place from where abc.dll was first registered?

  3. if i do any code change to abc.dll(com dll), even without changing its version#, i understand i still need to re-register abc.dll, is that correct?

  4. How do i find out what all dependencies a com component has with their version information?

Thank you.


Solution

    1. When you register a component, or add it to an application in the catalog, its location is set up in the registry. No duplicate is created.
    2. You will encounter an ERROR_MOD_NOT_FOUND error when trying to initialize the class.
    3. Windows will first look for the dependent DLL in the application directory before trying other locations. The directory of the registered COM component doesn't play a role in the subsequent search order.
    4. Unless you drastically change the layout of your component, such as changing a UUID, or adding new interfaces or classes, there is no need to re-register the DLL.
    5. You could try Dependency Walker.