static void Main(string[] args) { var demo = new DemoOne(); var catalog = new AggregateCatalog(); catalog.Catalogs.Add(new AssemblyCatalog(typeof(IDemo).Assembly)); CompositionContainer container = new CompositionContainer(catalog); container.ComposeParts(demo); demo.Run(); Console.ReadLine(); }