Managed Extensibility Framework integration for Autofac. Enables MEF catalogs to be loaded by the Autofac container.
$ dotnet add package Autofac.MefManaged Extensibility Framework (MEF) integration for Autofac.
Please file issues and pull requests for this package in this repository rather than in the Autofac core repo.
The Autofac/MEF integration allows MEF catalogs to be registered with the ContainerBuilder using the RegisterComposablePartCatalog() extension method. If you register a component using MEF and want to provide Autofac components into that MEF component, use the Exported() extension.
var builder = new ContainerBuilder();
var catalog = new DirectoryCatalog(@"C:\MyExtensions");
builder.RegisterComposablePartCatalog(catalog);
builder.RegisterType<Component>()
.Exported(x => x.As<IService>().WithMetadata("SomeData", 42));
Check out the Autofac MEF integration documentation for more information.
Need help with Autofac? We have a documentation site as well as API documentation. We're ready to answer your questions on Stack Overflow or check out the discussion forum.
3.5M