Autofac is a wonderful Dependency Injection/Inversion of Control .NET container written by Nicholas Blumhardt.
In fact it is so good, that the entire xLim 2 got migrated to it from Castle/Windsor Container in a couple of days and has gained a lot from that transition.
And if I had to choose between autofac and R#, I would keep the container. I actually had to make this choice when migrating from Castle (there was no R# 4.0 at that time).
Primary features are:
- Deterministic disposal of components
- Expression-based configuration
- Proper support for multi-scoped component resolution
- Lean codebase
Here’s the story of falling in love with autofac:
- One more interesting and fresh .NET IoC container: autofac
- Some more insight into the autofac
- XPO and Instance scopes in autofac
- Experience of migrating from Castle to autofac
- How to use IoC container with nested scopes for application composition?
- IoC Container Inspector
- How to avoid tight IoC coupling in non-deterministic resolution scenarios?
- ORM+IoC series
More posts are to come… You can additionally check all xLim posts (especially the ones on the extensibility and flexibility), since it heavily relies on the capabilities of autofac.
Snippets:
External Links:

4 Responses to “Autofac IoC Container”