<!-- markdownlint-disable MD041 --> Autofac is an IoC container for Microsoft .NET. It manages the dependencies between classes so that applications stay easy to change as they grow in size…
<!-- markdownlint-disable MD041 -->
!Autofac character
!Autofac logo
Autofac is an IoC container for Microsoft .NET. It manages the dependencies between classes so that applications stay easy to change as they grow in size and complexity. This is achieved by treating regular .NET classes as *components*.
  

Get Packages
You can get Autofac by grabbing the latest NuGet package. There are several application integration and extended functionality packages to choose from. If you're feeling adventurous, continuous integration builds are on MyGet.
Release notes are available on GitHub.
Get Help
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.
Get Started
Our Getting Started tutorial walks you through integrating Autofac with a simple application and gives you some starting points for learning more.
Super-duper quick start:
Register components with a ContainerBuilder and then build the component container.
csharp
var builder = new ContainerBuilder();
builder.Register(c => new TaskController(c.Resolve()));
builder.RegisterType();
builder.RegisterInstance(new TaskController());
builder.RegisterAssemblyTypes(controllerAssembly);
var container = builder.Build();
Resolve services from a lifetime scope - either the container or a nested scope:
csharp
var taskController = container.Resolve();
There is a growing number of application integration libraries that make using Autofac with your application a snap. Support for several popular frameworks is also available through the "Extras" packages.
Intrigued? Check out our Getting Started walkthrough!
Project
Autofac is licensed under the MIT license, so you can comfortably use it in commercial applications (we still love contributions though).
File issues in the repo with the associated feature/code.
- Autofac - Core dependency resolution and common functions (this repo).
- Autofac.AspNetCore.Multitenant - Multitenant DI support for ASP.NET Core applications.
- Autofac.Configuration - JSON/XML file-based configuration support.
- Autofac.Diagnostics.DotGraph - Diagnostics support to enable DOT graph visualization of resolve requests.
- Autofac.Extensions.DependencyInjection - .NET Core integration for Autofac.
- Autofac.Extras.AggregateService - Dynamic aggregate service implementation generation.
- Autofac.Extras.AttributeMetadata - Metadata scanning/filtering through attributes.
- Autofac.Extras.CommonServiceLocator - Common Service Locator implementation backed by Autofac.
- Autofac.Extras.DynamicProxy - Decorators and interceptors.
- Autofac.Extras.FakeItEasy - FakeItEasy mocking framework integration.
- Autofac.Extras.Moq - Moq mocking framework integration.
- Autofac.Mef - MEF catalog integration.
- Autofac.Multitenant - Multitenant dependency resolution support.
- Autofac.Multitenant.Wcf - Multitenant WCF service hosting.
- Autofac.Mvc - ASP.NET MVC integration.
- Autofac.Mvc.Owin - OWIN support for ASP.NET MVC.
- Autofac.Owin - Core OWIN support - shared middleware for request lifetime integration.
- Autofac.Pooling - Support for pooled instance lifetime scopes.
- Autofac.ServiceFabric - Application integration for Service Fabric services.
- Autofac.SignalR - Application integration for SignalR.
- Autofac.Wcf - WCF service hosting.
- Autofac.Web - ASP.NET web forms integration.
- Autofac.WebApi - Application integration for Web API.
- Autofac.WebApi.Owin - OWIN support for Web API.
Contributing / Pull Requests
Refer to the Contributor Guide for setting up and building Autofac source.
You can also open this repository right now in VS Code.
Members
-
Autofac ★ PINNED
An addictive .NET IoC container
C# ★ 4.7k 6d agoExplain → -
Examples ★ PINNED
Example projects that consume and demonstrate Autofac IoC functionality and integration
C# ★ 400 1mo agoExplain → -
Autofac.Extensions.DependencyInjection ★ PINNED
Autofac implementation of the interfaces in Microsoft.Extensions.DependencyInjection.Abstractions, the .NET Core dependency injection abstraction.
C# ★ 209 6d agoExplain → -
Autofac.Configuration ★ PINNED
Configuration support for Autofac IoC
C# ★ 41 6d agoExplain → -
Autofac.AspNetCore.Multitenant
Enables multitenant dependency injection support for ASP.NET Core.
C# ★ 114 1mo agoExplain → -
Autofac.Extras.DynamicProxy
Interceptor and decorator support for Autofac IoC via Castle DynamicProxy
C# ★ 109 6d agoExplain → -
Documentation
Usage and API documentation for Autofac and integration libraries
JavaScript ★ 71 16d agoExplain → -
Autofac.Mvc
ASP.NET MVC integration for Autofac
C# ★ 50 5d agoExplain → -
Autofac.Multitenant
Multitenant application support for Autofac IoC
C# ★ 40 6d agoExplain → -
Autofac.Extras.Moq
Moq auto mocking integration for Autofac IoC
C# ★ 38 6d agoExplain → -
Autofac.WebApi
ASP.NET Web API integration for Autofac
C# ★ 36 1mo agoExplain → -
Autofac.ServiceFabric
Autofac integration for Azure Service Fabric. Provides service factory implementations for Actors, Stateful Services and Stateless Services.
C# ★ 26 1mo agoExplain → -
Autofac.Wcf
Windows Communication Foundation (WCF) integration for Autofac IoC
C# ★ 22 1d agoExplain → -
Autofac.Owin
OWIN integration for Autofac
C# ★ 22 2d agoExplain → -
Autofac.Mef
Managed Extensibility Framework (MEF) integration for Autofac IoC
C# ★ 19 6d agoExplain → -
Autofac.SignalR
SignalR integration for Autofac IoC
C# ★ 11 2d agoExplain → -
Autofac.Web
ASP.NET WebForms integration for Autofac
C# ★ 11 1mo agoExplain → -
Autofac.AspNetCore
Autofac extensions and helpers for ASP.NET Core
C# ★ 10 1mo agoExplain → -
Autofac.WebApi.Owin
OWIN support for the ASP.NET Web API integration for Autofac
C# ★ 9 1mo agoExplain → -
Autofac.Extras.FakeItEasy
FakeItEasy auto mocking integration for Autofac IoC
C# ★ 8 6d agoExplain → -
Autofac.Extras.CommonServiceLocator
Common Service Locator implementation for Autofac IoC
C# ★ 7 6d agoExplain → -
Autofac.Extras.NHibernate ▣
Autofac implementation of the NHibernate factories
C# ★ 6 1mo agoExplain → -
Autofac.Extras.AggregateService
Dynamic aggregate service implementation generation for Autofac IoC
C# ★ 4 6d agoExplain → -
Autofac.Diagnostics.DotGraph
Autofac diagnostics support to enable DOT graph visualization of resolve requests.
C# ★ 4 6d agoExplain → -
Autofac.Extras.MvvmCross ▣
MvvmCross integration for Autofac IoC
C# ★ 4 1mo agoExplain → -
Autofac.Pooling
Support for pooled instance lifetime scopes in Autofac dependency injection.
C# ★ 3 6d agoExplain → -
Autofac.Extras.AttributeMetadata
Attribute metadata support for Autofac IoC
C# ★ 3 1mo agoExplain → -
Autofac.Extensions.Hosting
Fluent configuration of Autofac with the Microsoft.Extensions.Hosting package
C# ★ 3 1mo agoExplain → -
Autofac.Multitenant.Wcf
Multitenant Windows Communication Foundation (WCF) enhancements for Autofac IoC
C# ★ 3 1mo agoExplain → -
Autofac.Mvc.Owin
OWIN support for the ASP.NET MVC integration for Autofac
C# ★ 2 1mo agoExplain → -
Autofac.Bot.Api ▣
Handlers for Autofac Bot commands that can be used to execute various Autofac tasks like running benchmarks.
C# ★ 2 5y agoExplain → -
Autofac.Analyzers
Roslyn code analyzers to help with Autofac usage.
C# ★ 1 1mo agoExplain → -
autofac-bot ▣
GitHub application based on Probot for executing common Autofac-based tasks.
TypeScript ★ 1 6y agoExplain → -
Autofac.Extras.DomainServices ▣
Autofac Domain Service Factory for RIA Services
C# ★ 1 1mo agoExplain → -
.github
Default community health files for the Autofac organization.
★ 0 29d agoExplain → -
autofac.github.com
Autofac "product site" repository
HTML ★ 0 1mo agoExplain → -
Autofac.Extras.EnterpriseLibraryConfigurator ▣
Microsoft Patterns and Practices Enterprise Library 5 support for using Autofac as the container.
C# ★ 0 1mo agoExplain → -
CnRedirectPlaceholder
Placeholder repository needed to support redirecting from the old autofaccn.readthedocs.io domain.
★ 0 5y agoExplain →
No repos match these filters.