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:

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: