I have a VSTO addin that I want to add a plugin loading mechanism to. I publish the addin to a location on my hard drive, with the plugins in a separate folder. I load plugins from assemblies using Assembly.LoadFile(). The plugins folder
is outside of the AppDomain ApplicationBase.
One of the plugins depends on a COM object, and Visual Studio automatically generates an interop assembly for the COM object. But when I try to use that plugin, I get an exception saying that the interop assembly cannot be found. It is in the
plugins folder, along with the plugin assembly itself.
I tried adding the plugin directory to the PrivateBinPath, but since it is outside the ApplicationBase, this is ignored. It works if I put the interop assembly in the folder where the published VSTO addin is, but don't see that as a solution as it
requires manually moving DLLs around each time things get rebuilt.
Is there some way of telling the framework where to look for the dependency? Or even of loading the dependency explicitly? Since the dependency is also a .dll in the plugins folder, my plug-in loader attempts an Assembly.LoadFile on it, but this
doesn't seem to help the framework to resolve the dependency when I try to use the plugin.
View Complete Post