ReflectionTypeLoadException

Jul 15, 2010 at 12:45 PM

Thanks for the Secured Catalogs.

When I call compositionContainer.GetExports<Interface>(), I get an ReflectionTypeLoadException cause not all types (assemblies) the Extension (Plugin) uses are available.

Is there a way to get all exports, except these ones which have missing dependencies, without gettting a ReflectionTypeLoadException?

 

I know the following is only a quick and dirty workaround.

I added a asm.GetTypes()-call after the assembly was loaded successfully to enforce the ReflectionTypeLoadException.

private AssemblyCatalog CreateAssemblyCatalogGuarded(string assemblyFilePath)
        {
            Exception exception = null;

            try
            {
                Assembly asm = LoadAssembly(assemblyFilePath, _isAuthorized);
                asm.GetTypes();