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:
AddinManager
giving the .dll pathAddinManager.Registry
giving the .dll paththe code structure is quite complex (involves many files and projects) so is not so easy to paste or give some working code.
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.