Changelog History
Page 1
-
v5.1.0 Changes
October 24, 2020๐ This release is available through Nuget.
๐ When upgrading to v5, please make sure you upgrade your application to the latest v4.x version of Simple Injector first. After that, upgrade to the latest v5.0.x release before upgrading to v5.1.x.
๐ This minor release adds two new features to the core library:
- ๐
#857
Collection.Append
andCollection.Register
can now be called while supplying both a lifestyle and open generic implementations. - ๐ #861
DependencyMetadata<T>
can now be used in conjunction with Flowing scopes.
Thanks to @henriblMSFT for providing high-quality feature requests that made this possible.
- ๐
#857
-
v5.0.4 Changes
October 15, 2020๐ฆ Simple Injector v5.0.4 is available through Nuget.
๐ When upgrading to v5.0, please make sure you upgrade your application to the latest v4.x version of Simple Injector first. After that upgrade directly to the latest v5.0.x release.
๐ This patch release fixes three bugs:
- #850 Conditional registrations can now be made when
AllowOverridingRegistrations
is set to true - #836 Conditionally register instances of the same type can now be registered (thanks to @kwlin)
- ๐
#859 When calling
Lifestyle.Singleton.CreateRegistration
using aFunc<object>
delegate, C# overload resolution would cause the incorrectCreateRegistration
overload to be called.
- #850 Conditional registrations can now be made when
-
v5.0.3 Changes
August 22, 2020๐ฆ Simple Injector v5.0.3 is available through Nuget.
โฌ๏ธ Before you upgrade to v5.0, please make sure you upgrade your application to the latest 4.x version of Simple Injector first.
๐ This patch release improves reporting of duplicate registrations during Auto-Registration in case the same assembly is (accidentally) loaded twice (while the runtime considers them separate assemblies). Simple Injector will now report (through an exception message) that the assembly is loaded more than once and it describes how to solve this problem.
-
v5.0.2 Changes
June 28, 2020๐ฆ Simple Injector v5.0.2 is available pthrough Nuget](https://www.nuget.org/packages/SimpleInjector/).
โฌ๏ธ Before you upgrade to v5.0, please make sure you upgrade your application to the latest 4.x version of Simple Injector first.
๐ This patch release fixes issue #829 and allows collections with Scoped dependencies be resolved from a Scope when the 'Flowing' scoping model is used.
-
v5.0.0 Changes
June 11, 2020๐ Release Notes
๐ Simple Injector v5 is available through Nuget. For more background information about this release and a general overview, please read the blog post.
โฌ๏ธ Before you upgrade to v5.0, please make sure you upgrade your application to the latest 4.x version of Simple Injector first.
๐ For the release notes of the ASP.NET Core integration packages, go here.
Overview
๐ The most prominent changes and improvements in this release are:
- #692 No more .NET 4.0. We decided to drop support for the legacy version 4.0 of the .NET Framework. Minimum supported versions are .NET 4.5 and .NET Standard 1.0.
- #557 No more first-chance exceptions. The chance of having your IDE stop at an exception that can safely be continued (a first-chance exception), are now much smaller.
- #747 Container is now automatically verified when first resolved.
- #780 Unregistered concrete types are no longer resolved.
- #747 Simplified registration of disposable components. Disposables can now more easily be registered using
Lifestyle.Scoped
because Simple Injector now allowsTransient
dependencies to be injected without causing verification errors. - ๐ #820: Registration/startup performance improved. We managed make your application load faster. In extreme cases startup performance is improved up to 60%.
- #791 Asynchronous disposal.
Container
andScope
classes now implementIAsyncDisposable
to allow asynchronous disposal of components (only in .NET 4.6.1, .NET Standard 2.0, and .NET Standard 2.1 versions) - ๐ #393 Injection of metadata. In more advanced scenarios, infrastructural components can benefit from receiving additional metadata for injected components. You can now out-of-the-box inject
SimpleInjector.DependencyMetadata<TService>
into your infrastructural components to get the actual implementation type, even when that component is intercepted with decorators. This also works for collections.
๐ฅ Breaking changes
๐ Below you find the complete list of all the breaking changes in the core library and all officially supported integration libraries.
Simple Injector core library
- #747 Verification is now automatically performed upon the very first call to
GetInstance()
. You will be affected if you purposely skipped verifying the container. This behavior can be disabled by settingContainer.Options.EnableAutoVerification = false;
- #694 When calling
RegisterConditional
, thePredicateContext.Consumer
property will now never return null, but instead it throws an exception. Use the newPredicateContext.HasConsumer
property instead of checking for null. You will be affected when you checkedPredicateContext.Consumer
fornull
. - #816 Verification now allows Transient components to be injected into Scoped components by default. This behavior can be disabled by setting
Container.Options.UseStrictLifestyleMismatchBehavior = true
- ๐ #393 The
where TService : class
type constraint was removed fromInstanceProducer<TService>
InstanceProducer
constructor became obsolete.- ๐ป #700 Decorating container-uncontrolled collections with a singleton decorator will now throw an exception.
- ๐ #692 Removed support for .NET 4.0.
- 0๏ธโฃ #557
ConstructorInfo GetConstructor(Type)
method ofIConstructorResolutionBehavior
interface replaced withConstructorInfo? TryGetConstructor(Type, out string?)
method. You will be affected when you replaced the default constructor resolution behavior. - 0๏ธโฃ #557
void Verify(InjectionConsumerInfo)
method ofIDependencyInjectionBehavior
interface replaced withbool VerifyDependency(InjectionConsumerInfo, out string?)
method. You will be affected when you replaced the default dependency injection behavior. - ๐ง #780 Unregistered concrete types will not be resolved any longer. You will be affected when your configuration depends on unregistered concrete types. This behavior can be disabled by setting
Container.Options.ResolveUnregisteredConcreteTypes = true;
. - #275
Options.EnableDynamicAssemblyCompilation
is now obsolete and replaced with a newOptions.ExpressionCompilationBehavior
. - ๐ #809 Several obsoleted methods and classes that previously caused compile errors (due to the use of the
ObsoleteAttribute
) have been removed. To prevent any problems, make sure you upgrade to the latest v4.x release first before upgrading to v5. Only upgrade to v5 after fixing all compiler warnings and errors . - #810 Several obsoleted properties, methods, and classes that where marked as obsoleted are now marked with
Obsolete(error: true)
which will cause a compiler error when used:- All
AdvancedExtensions
methods (IsLocked
,IsVerifying
,GetItem
,SetItem
,GetOrSetItem<T>
, andAppendToCollection
) Container.RegisterCollection
overloads (they have been replaced withContainer.Collection.Register
)Container.RegisterSingleton
overloads for registering already existing instances (they have been replaced withContainer.RegisterInstance
methods)Scope
's default constructor
- All
- ๐
#820:
Lifestyle
: protectedLifestyle.CreateRegistrationCore<T>(Container)
method removed. You should now inherit fromLifestyle.CreateRegistrationCore(Type, Container)
. It has the same semantics. - ๐
#820:
Registration
:Type implemenationType
andFunc<object> instanceCreator = null
parameters added toRegistration
constructor. You will be affected when you developed a custom lifestyle. - ๐
#820:
Registration
:BuildTransientDelegate<TService>(Func<TService>)
removed. You can callBuildTransientDelegate()
instead. You will be affected when you developed a custom lifestyle. - ๐
#820:
Registration
:BuildTransientExpression<TService>(Func<TService>)
removed. You can callBuildTransientExpression()
instead. You will be affected when you developed a custom lifestyle.
๐ Packaging, WCF, Web, and Web API Integration
- ๐ #809 Several obsoleted methods and classes have been removed. To prevent any problems, make sure you upgrade to the latest v4.x release first before upgrading to v5. Only upgrade to v5 after fixing all compiler warnings and errors
API changes
Simple Injector core library
- ๐
#229
Lifestyle.Singleton.CreateRegistration(Type, object, Container)
method added for the creation ofRegistration
instances for already-created instances, including value types. - ๐ #694
PredicateContext.HasConsumer
property added to see whether there is a consumer or the type is being resolved directly from the container. - ๐
#816
Options.UseStrictLifestyleMismatchBehavior
property added that replaces the oldOptions.UseLoosenedLifestyleMismatchBehavior
. - #393
InstanceProducer.ImplementationType
property added. - ๐ #393
DependencyMetadata<TService>
class added. You can now inject aDependencyMetadata<TService>
orIEnumerable<DependencyMetadata<TService>>
into a consumer to get metadata about the injected dependency. - #791
Container
now implementsIAsyncDisposable
(only in .NET 4.6.1, .NET Standard 2.0, and .NET Standard 2.1 versions). - #791
Scope
now implementsIAsyncDisposable
(only in .NET 4.6.1, .NET Standard 2.0, and .NET Standard 2.1 versions). - #557 static
DependencyInjectionBehaviorExtensions
class added withVerify
extension method to mimic the old behavior ofIDependencyInjectionBehavior
. - #557 static
ConstructorResolutionBehaviorExtensions
class added withGetConstructor
extension method to mimic the old behavior ofIConstructorResolutionBehavior
. - #810
Container.IsLocked
property added.
API Difs
- ๐ฆ SimpleInjector
- ๐ฆ SimpleInjector.Integration.Wcf
- ๐ฆ SimpleInjector.Integration.Web
- ๐ฆ SimpleInjector.Integration.WebApi
Complete list of bugs, features and improvements
๐ -#229 Remove the reference-type restriction from
Container.RegisterConditional
andLifestyle.CreateRegistration
- 0๏ธโฃ #747 Enable Automatically perform verification upon first resolve by default.
- #694 Prevent
PredicateContext.Consumer
from returning null. - ๐ #816 Make 'loosened lifestyle mismatch behavior' the default.
- ๐ #393 Allow dependency to be injected with additional metadata.
- #791 Add
IAsyncDisposable
integration usingScope.AsyncDispose
andContainer.AsyncDispose
. - ๐ #700 Drop support for decorating uncontrolled collections using a singleton decorator.
- ๐ #692 Remove support for .NET 4.0.
- #557 Prevent first-chance exceptions.
- #589 Allow the registration and resolving of ActiveX / Proxy instances.
- 0๏ธโฃ #780 Disable resolving concrete types by default.
- ๐ #275 Move Dynamic Assembly Compilation to different assembly.
- ๐ #820 Improve startup/configure performance by replacing.
Lifestyle.CreateRegistrationCore<T>(Container)
withLifestyle.CreateRegistrationCore(Type, Container)
. - ๐ป #818 Unresolved conditional root types lead to confusing exception message
- #815 Resolving a stream collection always resolves the first instance
-
v4.10.3 Changes
April 25, 2020๐ Release Notes
๐ฆ Simple Injector can be downloaded using NuGet.
๐ This patch release only updates the
SimpleInjector.Integration.ServiceCollection
library. No new NuGet package is published for the core library and other unrelated integration packages.๐ Fixes
ServiceCollection integration library
-
v4.10.2 Changes
April 24, 2020๐ Release Notes
๐ฆ Simple Injector can be downloaded using NuGet.
๐ฆ > NOTE: Due to a merging error, the NuGet package containing Simple Injector 4.10.0 and 4.10.1 are identical to that of Simple Injector 4.9.2.
๐ This is a small minor release, which adds just some overloads to
Container.Collection.Register
in the core library. See below for more details.๐ Improvements
Simple Injector core library
- ๐
#808 Added
Container.Collection.Register
overloads that accept aLifestyle
argument
- ๐
#808 Added
-
v4.10.1
March 25, 2020 -
v4.10.0
March 25, 2020 -
v4.9.2 Changes
April 08, 2020๐ Release Notes
๐ฆ Simple Injector can be downloaded using NuGet.
๐ Bug fixes
Simple Injector core library
- ๐ป #807 Improved exception messages when an incomplete registration is encountered. More specifically, in some special cases,
RegisterConditional
registrations were not considered when constructing an exception message that warned about registrations with a similar naming.
- ๐ป #807 Improved exception messages when an incomplete registration is encountered. More specifically, in some special cases,