Skip to content

@dotnetjunkie dotnetjunkie released this Jan 6, 2020 · 4 commits to v4.9.x since this release

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.


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)
Assets 2
You can’t perform that action at this time.