Autofac update 2.6.1 published

The eagle-eyed may have already spotted Autofac 2.6.1 lurking in the NuGet feed.

The last release, the venerable 2.5.2, served us very well (maturity is a feature!) and this release adds a little more polish, without any known breaking changes.

  • The ASP.NET MVC integration package gets a bug fix for recursive views, UrlHelper and RequestContext registered by AutofacWebTypesModule, and an explicit method for registering model binders.
  • The WCF integration package gets much improved support for services with InstanceContextMode.Single.
  • A new helper InstancePerOwned<T>() makes it easier to control lifetime when using Owned<T>.
  • Autofac can now be used with .NET Portable Class Libraries (download only on the project site. (The Windows Phone 7 build now uses this configuration too.)
  • Autofac.dll is now clear of any issues found by SecAnnotate.exe.

Extra thanks to Alex and Travis for the majority of these improvements.

  • Pingback: Dew Drop – March 6, 2012 (#1,280) | Alvin Ashcraft's Morning Dew()

  • Michael

    Hello Nicholas,
    What is the recommended approach to using AOP Interception for example with Logging when using Autofac now. Available examples show logging using Castle and AutofacContrib.DynamicProxy2, but these not longer seem to work with later versions of Autofac.
    Thanks
    Michael

  • Tertius Cloete

    Hi,

    Let me start by congratulating you on designing a GREAT tool!

    Can you help me with these two compile errors. I’m using Autofac-2.6.1.841-NET40.

    Warning 7 The referenced assembly “Autofac.Integration.Wcf” could not be resolved because it has a dependency on “System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” which is not in the currently targeted framework “.NETFramework,Version=v4.0,Profile=Client”. Please remove references to assemblies not in the targeted framework or consider retargeting your project. AloeFeroxServiceTest

    Warning 6 The referenced assembly “Autofac.Integration.Wcf” could not be resolved because it has a dependency on “System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” which is not in the currently targeted framework “.NETFramework,Version=v4.0,Profile=Client”. Please remove references to assemblies not in the targeted framework or consider retargeting your project. AloeFeroxServiceTest

    Thank you in advance,

    Tertius Cloete

    tfcloete@gmail.com

  • Leonardo Prasetyo

    Hi Nicholas,

    Does Autofac work even for obfuscated code? How would it support multiple components for same service?

    Thanks!

  • @Michael – I’m not sure what working AOP implementations exist at the moment, it would be great to track down an updated integration for Dynamic Proxy but I don’t think anyone’s done the work.

    @Tertius – Your project is targeting the .NET Framework Client Profile, which doesn’t contain WCF. Target the full profile (via your project’s properties) and all will work fine.

    @Leonardo – Yes, obfuscated code is fine. Last-registered-wins when multiple implementations are registered, or you can resolve them as an array/IEnumerable. Hope this helps, Stack Overflow is also a great place for these kinds of questions. Cheers!

  • Paul Saxton

    Hi Nicolas

    Please can you take a look at my post on

    http://stackoverflow.com/questions/12090569/translating-structure-map-into-autofac

    I urgently need help on how to convert structure map code across to Autofac?

    Cheers

    Paul