[英]C# - Dynamically Loaded Assembly Access To Parent Assembly References
I am trying to implement a plug-in style architecture. 我正在尝试实现插件样式的体系结构。 There are core, external libraries used by both the plug-ins, and in the main application. 插件和主应用程序都使用核心的外部库。 A good example of such library is JSON.NET. 此类库的一个很好的示例是JSON.NET。
As I develop plug-ins, I make reference to the same JSON.NET version referenced in the main application. 在开发插件时,我引用了主应用程序中引用的相同JSON.NET版本。 When the plug-in is compiled, I have not been merging the external libraries with the plug-in, as I expected the references to resolve to the same assemblies loaded by the main application. 编译插件时,我尚未将外部库与插件合并,因为我希望引用能够解析为与主应用程序加载的相同程序集。
However, this isn't working. 但是,这不起作用。 When I try to invoke methods of the plug-in in the main application, I am getting "could not load assembly..." error. 当我尝试在主应用程序中调用插件的方法时,出现“无法加载程序集...”错误。
How to go about making the dynamically loaded plugins resolve references the main application's references? 如何使动态加载的插件解析主应用程序的引用?
A few considerations: 一些注意事项:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.