Question

I've a quite complex application, this application is structured like so:

Main.exe (is a standalone application)

Main.exe uses Project1.dll (which contains a form)

the form contained inside the Project1.dll is extended by another dll (Project2.dll) using mono.addins

In Main.exe I can see the form extended in the correct way.

I've also implemented an autocad connector (say Project3.dll) which is loaded via netload inside autocad, this connector uses the form of Project1.dll and that form has to be extended also in autocad.

The result is that inside autocad my form appears not extended, and if I debug the code:

        AddinManager.Initialize();
        AddinManager.Registry.Update(null);

        foreach (IMyPlugin Addin in AddinManager.GetExtensionObjects(typeof(IMyPlugin)))
        {
            if (Addin.IsPluginLicensed)
                EmbedPlugin(Addin);
        }

the foreach doesn't yield any addin.

Notice that each of those .dll are stored in the same directory.

I suppose that the problem resides in the different location of the autocad exe file but I've tried some tweaks and none works..

I've tried:

  • create an .addins file that contains the .dlls path.
  • create a subfolder \addins\ with a copy of all the .dlls
  • initialize the AddinManager giving the .dll path
  • update the AddinManager.Registry giving the .dll path

the code structure is quite complex (involves many files and projects) so is not so easy to paste or give some working code.

Was it helpful?

Solution

I've solved the problem. Mono.Addins was loaded from LoadFrom context and this has led to a DllHell problem. Manually loading Mono.Addins like described here solved the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top