There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
GenericCatalog CreateDynamicExport returing null is some cases
If the importDefinition passed to CreateDynamicExport is a non generic interface the return value could be null. This should never happen or the program will crash.
Using reflector on CatalogExportProvider::GetExportsCore you will see why.
foreach (Tuple<ComposablePartDefinition, ExportDefinition> tuple in valueAllowNull.GetExports(definition))
I see two solutions: set the export before the return value if it is null or change:
if (importDefinitionType.IsClass || importDefinitionType.IsInterface)
I don't know if that change is correct but for now it seems to work around my issue.