Simple Injector v4.5 Release Notes

Release Date: 2019-03-21 // about 5 years ago
  • ๐Ÿš€ Release Notes

    ๐Ÿš€ This release can be downloaded using NuGet.

    ๐Ÿš€ The most prominent improvements in this release are:

    • The diagnostics will warn when injected injected collections are iterated/used inside constructors of singleton consumers.
    • The introduction of a Container.ContainerScope property that allows access to the singleton Scope.
    • The introduction of an Options.ResolveUnregisteredConcreteTypes switch that allows disabling resolving unregistered concrete types. Users are advised to change the setting to false. This prevents supprises in the future, as we are changing the default behavior to false in v5.0.
    • The addition of integration for ASP.NET Core 2.0 Razor Pages. The SimpleInjector.Integration.AspNetCore.Mvc package contains a new SimpleInjectorPageModelActivatorProvider class that can be added to ASP.NET's IServiceCollection and a container.RegisterPageModels(app) extension method that can be used to register Razor Page Models.

    ๐Ÿ’ฅ Breaking changes

    Simple Injector core library

    • ๐Ÿ’… #554 Iterating collections with scoped or transient dependencies inside a singleton consumer now causes an exception when resolved or verified to prevent captive dependencies/lifestyle mismatches. A suppression can be added in case the warning is a false positive.
    • #670 AdvancedExtensions.IsVerifying(Container) extension method was made obsolete. You can use the Container.IsVerifying property instead.

    ๐Ÿ”‹ Features and improvements

    Simple Injector core library

    • #377 Container.Options.ResolveUnregisteredConcreteTypes switch introduced that allows disabling resolving unregistered concrete types.
    • ๐Ÿ’… #648 Added information about lifestyles to when the container visualized object graph (both inside the VS debugger and when calling VisualizeObjectGraph). Special thanks to our new contributor @kwlin for implementing this.
    • ๐Ÿ’… #664 New Container.ContainerScope property allows access to the container-global Scope, which can be used to register objects for disposal and execute delegates when the container is disposed, while allowing to retrieve created disposables, which enables async dispose.
    • #603 New Collection.Append and Collection.AppendInstance overloads added that simplify appending registrations (and instances) to collections.

    ๐Ÿ“ฆ ASP.NET Core Integration packages

    • ๐Ÿ“ฆ #572 Added ASP.NET 2.0 Razor Page support to the ASP.NET Core MVC integration package.

    ๐ŸŒ ASP.NET (Web Forms / MVC) Integration

    • ๐Ÿ’… #671 Prevented WebRequestLifestyle from reusing the same Scope instance over multiple containers inside the same web request.

    ๐Ÿ› Bug fixes

    Simple Injector core library

    • ๐Ÿšš #540 Removed the use of ThreadLocal<T> from the decorator sub system, which could cause memory leaks in case the user didn't dispose the container.