Error being thrown when using multiple MEFS plugins that reference the same assembly

I have a project that uses MEFs and allows developers to add different plugins. Many of these plugins have similar methods and need to do similar things, so I created a base class in another project called PluginBase, which they inherit from. All of the plugins build to the same directory (where MEFs loads its catalog), and the PluginBase dll is also built to that directory.

If I only have 1 plugin in that directory, it works fine. If I have multiple that reference PluginBase, I get the error:

{"Could not load type 'BCDTravel.API.PluginBase.PluginBase' from assembly 'TEST.API.PluginBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.":"TEST.API.PluginBase.PluginBase"}

That is the only message that I receive.

I am guessing if I added PluginBase to the GAC it would work, but I don't really understand what the problem is. Is it a problem with the assembly being loaded multiple times?

Thanks!

Answers


The problem is that you are loading the same assembly multiple times. Put the assembly that your PluginBase class belongs to in the bin folder of your application and add it to the MEF Catalog from there. Load only plugin specific assemblies from Plugins folder.


Need Your Help

jQuery form submit query parameters

javascript jquery

I'm from Java and know nothing about jQuery, my application need to integrate with openid and i have to choose openid-selector as my client, it is a jQuery plugin that can send a form to server with

Mono for Android: ListView Delete Items NotifyDataSet Changed

c# android for-loop mono monodroid

I am trying to delete rows from a listview. When I click delete, the row is removed. The ListView, however, fails to update. I have to click the back button and come back to see the item removed. Is

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.