@dotnetjunkie dotnetjunkie released this Mar 23, 2018 · 3 commits to v4.1.x since this release

Assets 2

Release Notes

Simple Injector v4.1 can be downloaded using NuGet.

This release contains several smaller improvements and bug fixes to the core library and its integration packages. Most prominent changes are:

  • In our constant effort to improve the API, we obsoleted some methods and replaced them with other methods with the same behavior:
    • Container.RegisterSingleton(T) became Container.RegisterInstance(T)
    • Container.RegisterSingleton(Type, object) became Container.RegisterInstance(Type, object)
    • AdvancedExtensions.AppendToCollection overloads became Container.Collections.AppendTo
    • The WcfOperationLifestyle became obsolete. AsyncScopedLifestyle should be used instead.
  • The WCF Integration package is now compatible with the new async/await paradigm, which allows you to make your WCF service methods asynchronous. This requires the use of AsyncScopedLifestyle, and as a consequence, the integration package is now only compatible with .NET 4.5 and up.
  • Two improvements in the ASP.NET Core integration library simplify cross-wiring and the addition of middleware. These packages now require ASP.NET Core 2.0 or up.

Features and improvements

Simple Injector core library

  • RegisterSingleton(T) and RegisterSingleton(Type, object) overloads renamed to RegisterInstance #469
  • Overloads added to Container.Register and Container.RegisterSingleton to simplify batch-registration on a single assembly #486
  • Allow created disposable instances to be retrieved from their Scope #478
  • Simplified working with subsets of collections #517


  • UseMiddleware(Container) extension method added to ASP.NET Core integration package to simplify adding middleware #513
  • Simplified cross-wiring by introducing a new AutoCrossWireAspNetComponents() extension method #442


  • SimpleInjector.Integration.Wcf now supports async WCF service methods #447

Bug fixes

Simple Injector core library

  • Decorator registration didn't check whether supplied type contained generic type parameters, making the registration fail silently #394
  • RegisterDecorator overload that accepts lifestyle was missing generic constraints #499