AppDomain.AssemblyResolve doesn't work (as expected) with MEF

陌路散爱 提交于 2019-12-11 04:23:32

问题


I have this error:

Runtime error CS0234: The type or namespace name 'StiOracleSource' does not exist in the namespace 'Stimulsoft.Report.Dictionary'

I developed (VS 2012) an application that uses MEF (.NET 4.5) to interconnect several binary assemblies loaded from a database. One of its separate plug-in assemblies (implemented as an stand-alone executable) has dependency on a third party DLL (Database adapter) that cannot be included in the main application. When I run the plug-in as a stand-alone application everything goes fine but if I load that assembly as a MEF part into the main application then I got CS0234 error runtime despite I provide the third party DLL reference using AppDomain.CurrentDomain.AssemblyResolve event approach. Referencing the third party DLL in the main application doesn't help.

Can anyone explain why the plug-in assembly runs smoothly as a stand-alone application and why it is broken when it is executed as a part of the MEF?

来源:https://stackoverflow.com/questions/17404608/appdomain-assemblyresolve-doesnt-work-as-expected-with-mef

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!