public void Initialize() { var thisAssembly = this.GetType().Assembly; var targetAssembly = typeof(AspectHelper).Assembly; this.catalog = new AggregateCatalog(new AssemblyCatalog(thisAssembly), new AssemblyCatalog(targetAssembly)); this.container = new CompositionContainer(this.catalog); AspectHelper.RegisterForComposition(this.container, thisAssembly); this.target = this.container.GetExportedValue <TestMef>(); }
public void Cleanup() { this.container.Dispose(); this.catalog.Dispose(); this.target = null; }