Autofac.Mvc5 6.1.0

The ID prefix of this package has been reserved for one of the owners of this package by Prefix Reserved
.NET Framework 4.7.2
dotnet add package Autofac.Mvc5 --version 6.1.0
NuGet\Install-Package Autofac.Mvc5 -Version 6.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Autofac.Mvc5" Version="6.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Autofac.Mvc5 --version 6.1.0
#r "nuget: Autofac.Mvc5, 6.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Autofac.Mvc5 as a Cake Addin
#addin nuget:?package=Autofac.Mvc5&version=6.1.0

// Install Autofac.Mvc5 as a Cake Tool
#tool nuget:?package=Autofac.Mvc5&version=6.1.0


ASP.NET MVC integration for Autofac.

Build status

Please file issues and pull requests for this package in this repository rather than in the Autofac core repo.

If you're working with ASP.NET Core, you want Autofac.Extensions.DependencyInjection, not this package.

Quick Start

To get Autofac integrated with MVC you need to reference this MVC integration NuGet package, register your controllers, and set the dependency resolver. You can optionally enable other features as well.

protected void Application_Start()
  var builder = new ContainerBuilder();

  // Register your MVC controllers. (MvcApplication is the name of
  // the class in Global.asax.)

  // OPTIONAL: Register model binders that require DI.

  // OPTIONAL: Register web abstractions like HttpContextBase.

  // OPTIONAL: Enable property injection in view pages.
  builder.RegisterSource(new ViewRegistrationSource());

  // OPTIONAL: Enable property injection into action filters.

  // OPTIONAL: Enable action method parameter injection (RARE).

  // Set the dependency resolver to be Autofac.
  var container = builder.Build();
  DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

If you are using MVC as part of an OWIN application, you may be interested in the ASP.NET MVC OWIN integration.

Check out the Autofac ASP.NET MVC integration documentation for more information.

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.

Product Versions
.NET Framework net472 net48 net481
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (78)

Showing the top 5 NuGet packages that depend on Autofac.Mvc5:

Package Downloads

Bnsights.Mvc is RAD Helper DLL for MVC Projects in Bnsights DMCC. Also known as Bnsights Business Solutions Framework (BBSF).


Part of Vault libraries set designed to enhance usability of ASP.NET MVC 5+.


Data transfer objects for TouchConvert version one APIs.


Data transfer objects for TouchConvert version two APIs.


Base install for Jaywings Umbraco projects, provides lots of useful extensions, helpers, controllers and editors

GitHub repositories (27)

Showing the top 5 popular GitHub repositories that depend on Autofac.Mvc5:

Repository Stars
Versatile OAuth 2.0/OpenID Connect stack for .NET
Open Source ASP.NET MVC Enterprise eCommerce Shopping Cart Solution
NuGet Gallery is a package repository that powers Use this repo for reporting issues.
Sample web app for ASP.NET MVC 5, EF 6 Code First, AutoMapper, Autofac and TDD
Version Downloads Last updated
6.1.0 137,727 8/23/2022
6.0.0 1,757,060 9/28/2020
5.0.0 1,374,960 1/28/2020
4.0.2 7,056,911 4/10/2017
4.0.1 399,466 2/8/2017
4.0.0 1,376,741 8/10/2016
4.0.0-rc3-222 1,730 7/18/2016
4.0.0-rc3-219 3,178 7/1/2016
3.3.4 2,258,976 4/30/2015
3.3.3 567,433 9/4/2014
3.3.2 114,081 7/17/2014
3.3.1 88,789 7/2/2014
3.3.0 51,844 5/9/2014
3.2.1 30,786 3/27/2014
3.2.0 44,204 1/28/2014
3.1.0 42,194 12/28/2013
3.0.0 73,762 10/24/2013
3.0.0-rc1 4,277 9/3/2013