Releases: simpleinjector/SimpleInjector
Simple Injector v3.0.5
Release Notes
If you're upgrading from v2.x, please make sure you upgrade your application to the latest 2.8.x version of Simple Injector first. please read the v3.0 release notes first
Simple Injector v.3.0.5 is a patch release that fixes two bugs in the core library and fixes the assembly version number of the SimpleInjector.Extensions.ExecutionContextScoping.dll.
Bug fixes / improvements:
- Unconditional generic registration with type constraint could not be made when
Container.Options.AllowOverridingRegistrationswas set totrue. (fixes #116) - Improved exception message that communicates that registrations of collections are separated from other registrations. (fixes #115)
- AssemblyVersion and AssemblyFileVersion of SimpleInjector.Extensions.ExecutionContextScoping library was set to 2.4.0. (fixes #118)
Simple Injector v3.0.4
Release Notes
If you're upgrading from v2.x, please make sure you upgrade your application to the latest 2.8.x version of Simple Injector first. please read the v3.0 release notes first
Simple Injector v.3.0.4 is a patch release that fixes 3 bugs in the core library.
Bug fixes:
Simple Injector v3.0.3
Release Notes
If you're upgrading from v2.x, please make sure you upgrade your application to the latest 2.8.x version of Simple Injector first. please read the v3.0 release notes first
Simple Injector v.3.0.3 is a patch release that fixes 3 bugs in the core library.
Bug fixes:
Container.Verify()did not dispose instances registered usingWebRequestLifestylelifestyle. (fixes #95)RegisterConditionalwith type factory always resolved the first resolved type due to incorrect caching. (fixes #104)- Suppression of Lifestyle mismatch worked on wrong registration making it unintuitive and cumbersome to use and could cause accidental suppression of other mismatches. (fixes #108)
Simple Injector v3.0
Release Notes
Simple Injector v3 is available through Nuget, or you can download the .zip file here. For more background information about this release and migration guidance, please read the blog post. Also see the blog post for a cheat sheet with the most prominent breaking changes.
In Simple Injector v3.0 we are breaking with the past. We removed legacy methods, considerably simplified parts of the API, and added new compelling features.
What this means is that we expect that almost every developer will have to make changes to his composition root.
Before you upgrade to v3.0, please make sure you upgrade your application to the latest 2.8 version of Simple Injector first..
Most compelling new features for this release are the addition of the RegisterConditional method to make conditional and contextual registrations, and the addition of the Lifestyle.Scope Container.Options.DefaultScopedLifestyle pair to considerably simplify working with scoped lifestyles. The most prominent breaking changes are the replacement of the complete SimpleInjector.Extensions namespace and the rename of the methods RegisterSingle and RegisterAll to RegisterSingleton and RegisterCollection.
New features and improvements for the SimpleInjector.dll
Containerclass now implementsIDisposableto allow disposing singletons. (fixes #5)- Added
RegisterDecorator<TService, TDecorator>()methods to simplify registration of non-generic decorators (fixes #7) - Added
RegisterDecorator()as instance methods on theContainerclass. (fixes #7) Register(Type, Type)overloads now accept open-generic types as well. (fixes #7)- Added
Container.GetTypesToRegistermethod for batch registration. This method was previously hidden deep in the SimpleInjector.Extensions namespace. (fixes #7) - Added
Container.RegisterSingletonmethods as replacement forRegisterSinglemethods. The new method name is more intuitive. (fixes #44) - Added
Container.RegisterCollectionmethods as replacement forRegisterAll. The new method name is more intuitive. (fixes #42) InstanceProducer<TService>class added that inherits fromInstanceProducerand adds aTService GetInstance()method. The genericLifestyle.CreateProducermethods return anInstanceProducer<TService>. This simplifies the use of externally created instance producers. (fixes #39)DiagnosticResult.Severityproperty added to allow differentiating between warnings and information messages. (fixes #9)RegisterCollection(Type, IEnumerable<Registration>)now accepts open generic types as well. (fixes #22)- Added
Container.Register(Type, IEnumerable<Assembly>)andContainer.RegisterCollection(Type, IEnumerable<Assembly>)overloads for batch registration. (fixes #7) - Resolving variant collections is now supported for container-uncontrolled collections as well. (fixes #25)
RegisterConditionalmethods added to make conditional and contextual registrations for both non-generic and
closed-generic and open-generic types. (fixes #4)- Improved the message of the Lifestyle Mismatch diagnostic warning to include the concrete type in the message. (fixes #63)
- When overriding property injection behavior, property injection can be intercepted the using the
IDependencyInjectionBehaviorin the same way as constructor parameters can. (fixes #59) Lifestyle.Scopedproperty added to simplify registration of scoped lifestyles. (fixes #38)- In case of a cyclic dependency graph, the thrown exception now includes information about the graph. (fixes #68)
ScopedLifestylederivatives don't have to overrideLengthanymore and all scoped lifestyles will have the same length. This will make the diagnostic services to treat them as the same lifestyle.- Improved support for huge object graphs. (fixes #91)
Breaking changes for the SimpleInjector.dll
- Unregistered collections are not resolved as empty collections by default anymore. Collections need to be registered explicitly. You can fallback to the old v1/v2 behavior by calling
container.Options.ResolveUnregisteredCollections = true;. (fixes #98) IConstructorVerificationBehaviorandIConstructorVerificationBehaviormade obsolete and replaced with a newIDependencyInjectionBehaviorabstraction that combines the two. (fixes #2)- Constructor overload
Container(ContainerOptions)removed fromContainer. (fixes #40) - Made
ScopedLifestyle.WhenScopeEndsmethod non-virtual. (fixes #11) - Made
ScopedLifestyle.RegisterForDisposalmethod non-virtual. (fixes #11) - Made
ScopedLifestyle.CreateCurrentScopeProvidermethod abstract. (fixes #11) - Removed
ScopedLifestyle.DisposeInstancesmethod. (fixes #11) - Removed
Container.InjectPropertiesmethod. (fixes #12) - Removed the
Container.RegisterSinglemethod overloads. (fixes #44) - Removed the
Container.RegisterAllmethod overloads. (fixes #42) - Moved
DecoratorPredicateContextclass to theSimpleInjectorroot namespace. (fixes #7) - Moved
DecoratorContextto theSimpleInjectorroot namespace. (fixes #7) - Removed
RegisterSingleDecoratorextension methods.RegisterDecoratorcan be used instead. (fixed #7) - Removed
RegisterAllOpenGenericextension methods.RegisterCollectioncan now be used instead. (fixes #7) - Removed
RegisterOpenGenericandRegisterSingleOpenGenericextension methods.Registercan now be used instead. (fixes #7) - Renamed
OpenGenericPredicateContexttoPredicateContextand moved it to theSimpleInjectorroot namespace. (fixes #7) - Second argument of
Container.Register(Type, Type)renamed fromimplementationtoimplementationType. - Removed
RegisterManyForOpenGenericextension methods. EitherRegisterorRegisterCollectioncan be used instead. (fixes #7) - Removed
OpenGenericBatchRegistrationExtensions.GetTypesToRegisterextension methods.Container.GetTypesToRegistercan be used instead. (fixes #7) - Calling
Verify()orGetInstancewill always cause the container to check for lifestyle mismatches unlessContainer.Options.SuppressLifestyleMismatchVerificationis set. (fixes #46) - Calling
Verify()will now standard do diagnostic analysis. Diagnostic analysis can be suppressed by calling theVerify(VerificationOption)overload (but this is highly discouraged). (fixes #10) - Class constraint
where TService : classadded toGetAllInstances<TService>()method. - Renamed
PotentialLifestyleMismatchDiagnosticResultclass toLifestyleMismatchDiagnosticResult. There's nothing 'potential' about that mismatch. We're actually sure that this is a mismatch. (fixes #84) - Made
UnregisteredTypeEventArgsconstructor internal.
Breaking changes for the SimpleInjector.Extensions.LifetimeScoping.dll
- Removed the
LifetimeScopeclass.Scopecan be used instead. (fixes #12) - Removed the
SimpleInjectorLifetimeScopeExtensions.EnableLifetimeScopingmethod. The method has been marked obsolete since Simple Injector 2.6. (fixes #12)
Breaking changes for the SimpleInjector.Integration.Wcf.dll
- Removed the
WcfOperationScopeclass.Scopecan be used instead. (fixes #12) - Removed the
SimpleInjectorWcfExtensions.EnablePerWcfOperationLifestylemethod. The method has been marked obsolete since Simple Injector 2.6. (fixes #12)
Breaking changes for the SimpleInjector.Integration.Web.dll
- Removed the
SimpleInjectorWebExtensions.RegisterForDisposalmethod.WebRequestLifestyle.RegisterForDisposalcan be used instead. (fixes #12)
Breaking changes for the SimpleInjector.Integration.Web.Mvc.dll
- Removed the
SimpleInjectorMvcExtensions.RegisterMvcAttributeFilterProvidermethod.RegisterMvcIntegratedFilterProvidercan be used instead. (fixes #12)
Breaking changes for the SimpleInjector.Integration.WebApi.dll
- Removed the
SimpleInjectorWebApiExtensions.RegisterWebApiFilterProvidermethod. Please consult the Web API integration guide on how to inject dependencies into Web API filter attributes. (fixes #12)
Bug fixes:
- Registering a
Func<object>usingUnregisteredTypeEventArgs.Register(Func<object>)caused the Diagnostic system to throw aNullReferenceException. (fixes #49) - Prevented incorrectly mixing registrations for several types of collections. (fixes #8)
- Cyclic dependency in type registered using
RegisterOpenGenericcaused a stackoverflow. - Huge transient object graphs failed to be compiled and caused the CLR to throw a stackoverflow exception. (fixes #91)