Simple Injector v4.9 Release Notes

Release Date: 2020-01-06 // about 4 years 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)