Why isn't my COM interop dependency detected? Longish post

ikantspelwurdz

Well-known member
Joined
Dec 8, 2009
Messages
49
Programming Experience
1-3
This is on the long side because more detail will be more useful than less.

There is a VB6 app which I do not have the source code for. Let's call it "MXE." One of the files included is called called "mxinterface.dll." It defines an interface called "MXPlugin." This interface allows the development of MXE plugin classes. Implement the interface, and your class counts as an MXE plugin. You add plugins to MXE by typing the ProgID of your class into a config file.

I have two VMs, a dev VM and a test VM. Both have MXE installed, and "mxinterface.dll" is registered properly. Only the dev VM has any development tools installed.

I am trying to develop an MXE plugin, using VB.NET 2.0. I create an interop ("Interop.mxinterface.dll"), add a reference to this interop dll, and create a class that implements "MXPlugin." I test it on my dev machine, compile a Release version. The Release folder contains my plugin, and also "Interop.mxinterface.dll" and several other dependencies. I add a setup project, include the plugin project, and I build the MSI and install it on the test VM.

Tested it on the test VM, and it fails. MXE itself just says "not a valid plugin" when I try to use my plugin. This is the same thing it would say if I fed it an incorrect ProgID. I go crazy for about a day, but then I try manually copying "Interop.mxinterface.dll" into the plugin director, and suddenly it works.

I go back to my project, and I notice that "Interop.mxinterface.dll" is not part of the setup's detected dependencies! Even though my library project has an explicit reference to it, and the only public class in it implements an interface defined by it. I right click the setup project, Add->File, and select "Interop.mxinterface.dll." It and a bunch of other interops and dependencies get added to "detected dependencies." I rebuild the MSI, reinstall it on the test VM, and it works fine again.

So... what is going on? Why doesn't Visual Studio know that this interop is a dependency of my primary output?
 
Top Bottom