How do I get a MEF Directory catalog looking at th

2020-05-01 07:01发布

问题:

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



标签: plugins mef