Changelog History
Page 2
-
v4.9.1 Changes
March 06, 2020π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π Bug fixes
Simple Injector core library
- #414 Object graphs that consist of decorators with
Func<T>
decoratee factories are now visualized correctly. - #759 Object graphs that consist collections (e.g.
IEnumerable<T>
) are now visualized correctly.
π¦ ASP.NET Core Integration packages
- π» #802 Exception message improved that is thrown by the
SimpleInjectorControllerActivator
in case an unregistered controller is requested.
- #414 Object graphs that consist of decorators with
-
v4.9 Changes
January 06, 2020π 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 intoScoped
consumers using theContainer.Options.UseLoosenedLifestyleMismatchBehavior
configuration switch.
- Support for using
- 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.
- The container is now automatically disposed on web application shutdown, unless overridden using
π 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 theIServiceCollection
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 scopedIAsyncDisposable
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)
- Core library:
-
v4.8.1 Changes
November 30, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π Bug fixes
Simple Injector core library
-
v4.8 Changes
November 24, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π The most prominent improvements in this release are:
- π Full support for ASP.NET Core 3.
- The container can now perform verification on first resolve. This can be enabled using an option switch.
- The container now allows sending notifications to inform that the container is about to be locked.
- π Several small improvements and bug fixes.
π For the last few years, the development of ASP.NET Core has been in flux. We've seen breaking changes from release to release and we engaged in discussions with Microsoft about all kinds of issues and bugs that we came across. The introduction of ASP.NET Core v3 again caused some issues with Simple Injector. Those problems took us more time to analyze, discuss, design, test, document, and release.
π Finally, in this release we now truly support ASP.NET Core 3. To pull this off, we had to mark quite a few methods as obsolete and replace them with new methods. For the most part, you can follow the compiler-generated obsolete messages that you get once you upgrade to v4.8. Or refer to the documentation, if freshly apply Simple Injector to an ASP.NET Core application.
β¬οΈ > Note that the v4.8 integration libraries can be used in ASP.NET Core v2 as well, and we advise ASP.NET Core v2 users to upgrade to Simple Injector v4.8 as well, because of the bug fixes we made, and to make it easier later on to migrate to ASP.NET Core v3.
π The
Container
can now perform verification on first resolve. We found that many developers that are new to Simple Injector don't realize that Simple Injector allows verifying the configuration. To mitigate this, v5.0 will automatically verify the container for you when you resolve your first component, in case you, or one of your team members, forgot to callContainer.Verify()
. In this v4.8 release we add this feature, but leave it disabled by default to prevent any breaking changes. In v5 we will turn the switch. You can enable it by settingContainer.Options.EnableAutoVerification
totrue
or you can already set it to false to prevent verification in case you have your own safety net in place (e.g. by callingcontainer.Verify()
inside a unit test).π¦ We added a new event that you can subscribe and receive a notification when the container is about to get lockedβthis would typically happen when the first component gets resolved. This enables making last-minute registrations and allows spotting who is locking the container. The ASP.NET Core integration package is now the primary consumer of this eventβit needs this notification to successfully integrate with ASP.NET Core v3.
π Improvements
Simple Injector core library
- 0οΈβ£ #555 Allowed performing verification upon first resolve. This feature can be enabled by setting
Container.Options.EnableAutoVerification = true;
. The value isfalse
by default, but this will change in v5. - π¦ #767 Added the
Container.ContainerLocking
event that signals when the container is about to get locked. - π» #441 Resolving an unregistered collection now throws an exception with a message that explains that collections need to be registered explicitly and how to solve the issue.
π¦ ServiceCollection Integration package
- π #754 Added ASP.NET Core 3 support. To support ASP.NET Core 3, the following methods are added:
SimpleInjectorAddOptions.AutoCrossWireFrameworkComponents
property. Can be used from within theAddSimpleInjector
setup action.- New
CrossWire()
extension methods on top ofSimpleInjectorAddOptions
. They replace theCrossWire
extension methods on top ofSimpleInjectorUseOptions
. - New
AddLogging()
andAddLocalization()
extension methods on top ofSimpleInjectorAddOptions
. They replace theUseLogging()
andUseLocalization()
extension methods on top ofSimpleInjectorUseOptions
.
The following class members are now marked obsolete:
SimpleInjectorServiceCollectionExtensions
:UseLogging(SimpleInjectorUseOptions)
. You can callAddLogging(SimpleInjectorAddOptions)
instead as part of theAddSimpleInjector
setup action.UseLocalization(SimpleInjectorUseOptions)
. You can callAddLocalization(SimpleInjectorAddOptions)
instead as part of theAddSimpleInjector
setup action.CrossWire<TService>(SimpleInjectorUseOptions)
. You can callCrossWire<TService>(SimpleInjectorAddOptions)
instead as part of theAddSimpleInjector
setup action.
-
CrossWire(SimpleInjectorUseOptions, Type)
. You can callCrossWire(SimpleInjectorAddOptions, Type)
instead as part of theAddSimpleInjector
setup action.SimpleInjectorUseOptions
:AutoCrossWireFrameworkComponents
. Setting it has no effect any longer and using it will therefore cause a compile error. You can useSimpleInjectorAddOptions.AutoCrossWireFrameworkComponents
instead as part of theAddSimpleInjector
setup action.
π¦ ASP.NET Generic Host Integration package
- #754 Enabled hosted services to be integrated with Simple Injector and ASP.NET Core 3.
π¦ ASP.NET Core Integration packages
- π #754 Added ASP.NET Core 3 support.
The following class members are now marked obsolete:
SimpleInjectorAspNetIntegrationExtensions
:EnableSimpleInjectorCrossWiring()
. A call to.AddSimpleInjector()
automatically enables cross wiring.CrossWire<TService>(Container, IApplicationBuilder)
. Instead of callingCrossWire
on theContainer
, you can now callCrossWire
onSimpleInjectorAddOptions
.CrossWire(this Container, Type, IApplicationBuilder)
. Instead of callingCrossWire
on theContainer
, you can now callCrossWire
onSimpleInjectorAddOptions
.AutoCrossWireAspNetComponents(Container, IApplicationBuilder)
. Auto cross wiring is automatically enabled when calling.AddSimpleInjector()
.AutoCrossWireAspNetComponents(Container, IServiceProvider)
. Auto cross wiring is automatically enabled when calling.AddSimpleInjector()
.
SimpleInjectorUseOptionsAspNetCoreExtensions
:UseMiddleware<TMiddleware>(SimpleInjectorUseOptions, IApplicationBuilder)
. This method can cause your middleware to be applied at the wrong stage in the pipeline. This will, for instance, cause your middleware to be executed before the static files middleware (i.e. the.UseStaticFiles()
call) or before authorization is applied (i.e. the.UseAuthorization()
call). Instead callapp.UseMiddleware<TMiddleware>(Container)
, and make sure you call it at the right stage. This typically means after.UseStaticFiles()
and.UseAuthorization()
, but before.UseEndpoints(...)
.UseMiddleware(SimpleInjectorUseOptions, Type, IApplicationBuilder)
. Same as previous. Callapp.UseMiddleware(Container, Type)
instead.
π Bug fixes
π¦ ServiceCollection Integration package
- π» #713 Resolving cross-wired transient service outside of scope threw a too generic exception.
π¦ ASP.NET Core Integration packages
-
v4.7.2 Changes
September 19, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π This is a patch release that fixes a bug that prevented the ASP.NET Core MVC integration package to be used in combination with ASP.NET Core v3 (#748).
-
v4.7.1 Changes
September 02, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π This is a patch release that fixes a regression in the MVC integration package (#746).
-
v4.7 Changes
September 01, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π The most prominent improvements in this release are:
- π¦ #649 Implemented C# 8.0 non-nullable support. This affects the core library and all integration packages. The complete API is now annotated in such way that C# 8 can warn you want you are possible using a null reference.
- Simplify integration with
IStringLocalizer
andIStringLocalizer<T>
while integrating with .NET Core. Thanks to contributor @kwlin for implementing this.
π Improvements
Simple Injector core library
- π #649 Implemented C# 8 non-nullable support
- #736 Marked [Obsolete] message as error
#727 Added
GetService
method toScope
by implementingIServiceProvider
.
Usage:Scope scope = ...;IServiceProvider provider = scope;object? service = provider.GetService(typeof(SomeType));
π¦ ASP.NET Core Integration packages
- #717 Added non-generic
options.UseMiddleware
overload.
π¦ ServiceCollection Integration packages
#718 Simplify integration with
IStringLocalizer
andIStringLocalizer<T>
by adding anUseLocalization()
extension method. Implemented by @kwlin.
Usage:app.UseSimpleInjector(container, options =\>{ options.UseLocalization(); });
-
v4.6.2 Changes
July 27, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π Improvements
Simple Injector core library
- #731 ThreadAbortExceptions could cause the Container's internal state to get corrupt.
- #732 Diagnostic Analyzers did not respect
container.Options.UseFullyQualifiedTypeNames
- π» #719 Improved "The supplied list of types contains one or multiple open-generic types, but this method is unable to handle open-generic types" exception message
- π #720 Improved XML documentation on
Container.Collection.Append
overloads.
-
v4.6.1 Changes
July 23, 2019π Release Notes
π¦ Simple Injector can be downloaded using NuGet.
π Improvements
Simple Injector core library
- π
#734 When using the
Container.RegisterConditional(Type, Func<TypeFactoryContext, Type>, Lifestyle, Predicate<PredicateContext>)
overload, Simple Injector would invalidly supply theFunc<TypeFactoryContext, Type>
delegate with aTypeFactoryContext
instance whoseConsumer
property invalidly contained a non-null value, when the service type was resolved as root type.. This regression was introduced in v4.5.2.
- π
#734 When using the
-
v4.6 Changes
May 11, 2019π Release Notes
π This release can be downloaded using NuGet.
π The most prominent improvements in this release are:
- π New fluent configuration model for ASP.NET Core that aims to simplify integration. Please read the documentation for more details.
- π New integration packages for non-ASP.NET Core environments that still require
IServiceCollection
, such as .NET Core Console Applications and .NET Core 2.1 Generic Host. Read the documentation here and here for more details. - Ability to visualize object graphs with fully qualified type names. Implemented by @kwlin.
π₯ Breaking changes
Simple Injector core library
- #699
ExpressionBuiltEventArgs
ctor marked obsolete. - 0οΈβ£ #701
SimpleInjector.Scope
default ctor marked obsolete.
π Features and improvements
Simple Injector core library
- #685 VisualizeObjectGraph can now generate fully qualified type names. Thanks to @kwlin for implementing this.
- π
#691 Added
Container.Collection.Append(Type, Type, Lifestyle)
overload. - #706 Added the ability to ignore disposing scoped and singleton components.
- #681 Extra information added to obsolete messages.
- #689 Common
System.Object
methods (ToString
,GetHashCode
,Equals
, andGetType
) are now hidden from common API classes when using IntelliSense.
π¦ ASP.NET Core Integration packages
- π #684 New fluent API introduced. See the documentation for more details.
- #683 Prevented double disposing cross-wired dependencies.
π¦ [NEW] ServiceCollection Integration packages #639
π This is a new integration package that aims to simplify cross wiring on top of ServiceCollection. It contains the core functionality that is used by Generic Host and ASP.NET Core integration packages. See the documentation for more details.
π¦ [NEW] Generic Host Integration packages #639
π This is a new integration package that simplifies working with .NET Core 2.1 Generic Host applications. It can be use both as part of your ASP.NET Core application and as .NET Core Console application. See the documentation for more details.