C#中找不到组件,已加载中找、组件、加载

2023-09-03 07:59:38 作者:葵一般的少年

我写它采用插件的应用程序。插件是它存在于插件目录中类库。通过LoadFrom我的应用程序加载这些库。他们中有些人在其中处于同一插件目录库的形式依赖。当我尝试从通过Activator.CreateInstance插件之一,创建类的实例我收到一个异常无法找到程序集(这是插件的依赖组装),但该组件已加载(!)以及插件,它是可见ProcessExplorer。 我不能uderstand什么我的麻烦。

I am writing an application which uses plugins. Plugins are class libraries which lie in Plug-ins directory. My app loads these libraries via LoadFrom. Some of them have dependencies in the form of libraries which lie in the same Plug-ins directory. When I try to create instance of class from one of plugins via Activator.CreateInstance i recieve an exception 'Unable to find assembly' (this is dependency assembly of plugin), but this assembly is already loaded (!) along with plugins and It is visible in ProcessExplorer. I can't uderstand in what my trouble is.

推荐答案

我有类似的问题,他们通常通过改变目标框架在项目属性解决...

I had similar problems and they were usually solved by changing target framework in the project properties...