Simple Injector v4.9 Release Notes

Release Date: 2020-01-06 // 23 days ago
  • 🚀 Release Notes

    📦 Simple Injector can be downloaded using NuGet.

    🚀 The most prominent improvements in this release are:

    • Core library:
      • Support for using ReadOnlyCollection<T> in the core library.
      • The container's Lifestyle Mismatch verification behavior can now be set to a less strict model allowing Transient dependencies to be injected into Scoped consumers using the Container.Options.UseLoosenedLifestyleMismatchBehavior configuration switch.
    • ASP.NET Core integration:
      • The container is now automatically disposed on web application shutdown, unless overridden using services.AddSimpleInjector(container, options => { options.DisposeContainerWithServiceProvider = false; }).
      • Scoped IAsyncDisposable components, created by Simple Injector during the course of a web request, will now be automatically, and asynchronously disposed.

    👌 Improvements

    Simple Injector core library

    • 👍 #762 Support for resolving and injecting ReadOnlyCollection<T> collections added
    • #781 Reports existing interface registrations when Options.ResolveUnregisteredConcreteTypes is false
    • 💅 #793 Added option to loosen the Lifestyle Mismatch verification behavior.

    📦 ServiceCollection Integration package

    • #787 The Container instance is now automatically appended to the IServiceCollection to simplify some integration scenarios.

    📦 ASP.NET Core Integration packages

    • #763 Allow Simple Injector container to be automatically disposed when integrated into ASP.NET Core
    • 📦 #778 Added support for IAsyncDisposable. The ASP.NET Core integration package will now automatically do asynchronous disposal of scoped IAsyncDisposable dependencies within the context of a web request.
    • 🛠 #730 Fixed an invalid message in an ObsoleteAttribute
    • #794 Some obsoleted messages are now marked with error: true and now cause compile errors.

    The following class members are now marked obsolete:

    • SimpleInjectorAspNetCoreMvcIntegrationExtensions.RegisterMvcControllers(Container, IApplicationBuilder)
    • SimpleInjectorAspNetCoreMvcIntegrationExtensions.RegisterMvcViewComponents(Container, IApplicationBuilder)
    • SimpleInjectorAspNetCoreMvcIntegrationExtensions.RegisterMvcViewComponents(Container, IViewComponentDescriptorProvider)
    • SimpleInjectorAspNetCoreMvcIntegrationExtensions.AddSimpleInjectorTagHelperActivation
    • SimpleInjectorAspNetCoreMvcIntegrationExtensions.RegisterPageModels
    • SimpleInjectorAspNetIntegrationExtensions.EnableSimpleInjectorCrossWiring(IServiceCollection, Container)
    • SimpleInjectorAspNetIntegrationExtensions.CrossWire<TService>(Container, IApplicationBuilder)
    • SimpleInjectorAspNetIntegrationExtensions.CrossWire(Container, Type, IApplicationBuilder)
    • SimpleInjectorAspNetIntegrationExtensions.AutoCrossWireAspNetComponents(Container, IApplicationBuilder)
    • SimpleInjectorAspNetIntegrationExtensions.AutoCrossWireAspNetComponents(Container, IServiceProvider)
    • SimpleInjectorUseOptionsAspNetCoreExtensions.UseMiddleware<TMiddleware>(SimpleInjectorUseOptions, IApplicationBuilder)
    • SimpleInjectorUseOptionsAspNetCoreExtensions. UseMiddleware(SimpleInjectorUseOptions, Type, IApplicationBuilder)

Previous changes from v4.8.1

  • 🚀 Release Notes

    📦 Simple Injector can be downloaded using NuGet.

    🐛 Bug fixes

    Simple Injector core library

    • 💅 #755 Improved a confusing Lifestyle Mismatch warning that went of when injecting a List<T> or array a Singleton.
    • 💅 #769 Fixed a false-positive Torn Lifestyle warning when using the forwarded collection registrations.