问题描述
我正在使用MEF向我们的WebApp使用的DAL添加插件.效果很好,但是当我们的服务层引用DAL时,它正在\ ServiceLayer \ Plugins \中寻找插件而不是\ WebSite \ Plugins \(这是有意义的,因为我们使用的是相对路径.{DirectoryCatalog(Path ="plugins/")}}.
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/")}.
问题是,如果我们使用绝对路径,它将拒绝从SL和DAL加载插件,我相信这是因为该路径不在加载插件的应用程序所在的目录或子目录中? ).我如何才能让它们从一个文件夹中同时加载插件?
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?
谢谢
推荐答案
您实际上无法做到这一点.解决方案是将DLL复制一份,一组放在Web应用程序文件夹中,另一组放在服务层文件夹中
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
这篇关于如何获得一个同时查看Servicelayer和DAL的目录的MEF目录目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!