Here’s the issue… if I use, say a directory catalog in MEF and have some.dll and copy of some.dll, i will get double the exports, even though they are defining the same type, is there a way to resolve this?
EDIT: the problem isn’t with this particular issue, this is just an abstract example of a real issue, for instance, if i have an “extensions” folder, and a way to manually import… it’s just something that would be nice to handle.
You can do this with a
FilteredCatalog(not part of the core MEF distribution.) See the example here: http://mef.codeplex.com/wikipage?title=Filtering%20CatalogsRather than selecting from the inner catalogs via
Whereyou may useDistinct. To compareComposablePartDefinitions for equality the simplest option is to useToStringbut casting toReflectionComposablePartDefinitionis also an option.HTH,
Nick