Wednesday, January 30, 2008

CompositeUI Application Block: TypeLoadException GetExportedTypes in ModuleLoaderService

(Don't mind the title, I put all the necessary keywords to help others having the same problem to find this post :)).

Have you ever tried loading un-loadable assemblies with CAB? Like, the ones that have unresolvable references or something similar. You won't get a normal assembly binder (or whatever it's called) error... No, the exception you will get will be a TypeLoadException that is thrown by a call to GetExportedTypes() in the ModuleLoaderService. With a cryptic message saying that some type (probably the first one in the assembly) couldn't be loaded. if this happens, go back and check if your assemblies have valid references.