How do I get a MEF Directory catalog looking at the same directory for both the Servicelayer and DAL?

帅比萌擦擦* 提交于 2019-12-02 06:50:32

问题


I'm using MEF to add plugins to our DAL which is used by our WebApp. This works fine, but when our service layer references the DAL, it's looking for plugins in \ServiceLayer\Plugins\ rather than \WebSite\Plugins\ (which makes sense are we're using a relative path. {DirectoryCatalog (Path="plugins/")}.

The problem is if we use an absolute path it refuses to load the plugins from both the SL and the DAL, which I believe is because the path isn't within the same directory or subdiectory of the App loading the plugins(?). How can I get them to both load plugins from one folder?

Thanks


回答1:


You can't actually do this. Solution was to have a copy of the DLLs, one set in the web app folder, another in the service layer folder



来源:https://stackoverflow.com/questions/3564523/how-do-i-get-a-mef-directory-catalog-looking-at-the-same-directory-for-both-the

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