In .NET, every exe or DLL file is called assembly 1 . Therefore, when you create a directory based on an "executing assembly" and use it at the application entry point, you include only the parts that are defined in the exe project. You are not getting the parts defined in the DLL.
Try replacing this:
var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
:
var catalog = new AggregateCatalog( new ComposablePartCatalog[] { new AssemblyCatalog(Assembly.GetExecutingAssembly()), new DirectoryCatalog(".") });
edit: I just found that there is a simpler solution:
var catalog = new DirectoryCatalog(".", "*");
( 1 ) Actually, an assembly may consist of several files, but this is rarely used. This term is also used for parallel COM.
Wim coenen
source share