# autofac/Autofac

An addictive .NET IoC container

Repository: https://github.com/autofac/Autofac
Canonical: https://ross.abutalabs.com/products/autofac
Homepage: https://autofac.org
Language: C#
License: MIT
License Family: permissive
Topics: autofac, ioc-container, c-sharp, netcore, netstandard, dependency-injection
Last push: 2026-08-01T23:51:16+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 83, longevity 100
- inputs: {"age_days": 4606, "days_push": 32, "days_rel": 32, "gap_med": 78.5, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4657, forks 846 (observed 2026-08-28T04:08:55.700710+00:00)

## What it is
Autofac is an Inversion of Control (IoC) dependency injection container for .NET, .NET Core, and ASP.NET Core. It manages class dependencies through component registration, constructor/property/method injection, lifetime scopes, and a flexible module system.

## Use cases
- resolve dependencies in a .NET application with an IoC container
- register services and inject them into constructors in ASP.NET Core
- manage service lifetimes and nested scopes in a large C# codebase
- scan assemblies to auto-register components by convention
- organize complex registrations into reusable modules
- replace the default Microsoft.Extensions.DependencyInjection container

## When to choose
- you need a mature, feature-rich DI container for .NET with lifetime scopes and assembly scanning
- you want flexible registration via lambdas, types, instances, or modules
- you need integration with ASP.NET Core, MVC, Web API, or other .NET frameworks

## When to avoid
- you only need simple DI and prefer the built-in Microsoft.Extensions.DependencyInjection
- you are not working in a .NET/C# environment

## Facets
- artifact type: library
- maturity: stable
- function: middleware, developer-tools
- domain: backend, developer-tools, web-development
- platform: dotnet, cross-platform, windows
- tags: ioc-container, dependency-injection, di, inversion-of-control, c-sharp, netcore, service-lifetime

## Member repositories
- autofac/Autofac (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:55.700710+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:28.012797+00:00, confidence not recorded.
  - readme: https://github.com/autofac/Autofac (fetched 2026-08-28T04:08:55.700710+00:00, sha e4e568606dfd)
  - homepage: https://autofac.org (fetched 2026-08-29T09:03:55.516185+00:00, sha 67f8f287bf56)
  - site_page: https://autofac.org/apidoc (fetched 2026-08-29T09:03:55.525200+00:00, sha 8430a70987fc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
