A suggestion that I believe would be beneficial to a lot of developers, would be to add the ability to register the parts of the Aggregate catalog, ignoring duplicates.
The issue is, that when I register my exported parts, I get duplicate registrations for the same Export - leading me to the exception, "ImportCardinalityMismatchException", when I try to Resolve<T>().
There isn't an easy work around that I have found and I believe it would be nice to have as part of this package.
Code sample below:
private static void RegisterAssemblies(string assemblyPath, string searchPattern)
string directories = Directory.GetDirectories(assemblyPath, "Debug", SearchOption.AllDirectories);
var exportedParts = new AggregateCatalog();
foreach (string directory in directories)
var assemblyCatalog = new DirectoryCatalog(directory);