Simple Injector Changelog

What's new in Simple Injector 5.4.5

Apr 26, 2024
  • Fixes in this release:
  • 996 Open-generic registrations for types with generic array generic type arguments can't be resolved

New in Simple Injector 5.4.4 (Jan 5, 2024)

  • Different Flowing Scopes Returning Same Instance of a Scoped Object from within a Singleton constructor

New in Simple Injector 5.4.3 (Dec 14, 2023)

  • Fixes in this release:
  • Improved performance when making many registrations for the same generic service type. Registration time was exponential and the time required to make a single registration increased with the number of registrations for that same generic service type. This improvement makes the time it takes to make the registration always as fast. From O(n) performance characteristic, we're now back to O(1).

New in Simple Injector 5.4.2 (Nov 15, 2023)

  • Removed a first-chance exception in the happy path of application and improved performance of the registration process.

New in Simple Injector 5.4.1 (Sep 29, 2022)

  • Fixes in this release:
  • #956 Fixed memory leak caused by incorrect use of ThreadLocal<bool>.

New in Simple Injector 5.4 (Jul 21, 2022)

  • Array and List collection types can now be resolved in conjunction with Flowing scopes.
  • New InstanceProducer.GetInstance(Scope) overload was added to allow resolving instances from an InstanceProducer in conjunction with Flowing scopes.
  • DependencyMetadata<T> can now be used in conjunction with Flowing scopes.
  • Bug fix: The IsClosedTypeOf extension method would returned true when the the given type was open generic; this also impacted GetClosedTypeOf and GetClosedTypesOf.

New in Simple Injector 5.3.3 (Jan 29, 2022)

  • Fixes in this release:
  • #925 Chaining identical decorators would result in a diagnostics error

New in Simple Injector 5.3.2 (Jul 2, 2021)

  • #911 Fully qualified type names in exceptions where lookalikes exist

New in Simple Injector 5.3.1 (Jun 13, 2021)

  • When upgrading from v4.x, 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.3.x release.
  • This patch fixes a caching bug in GetRegistration, which could cause a a call to GetRegistration or GetService to invalidly return null.
  • A call to GetRegistration(Type) and GetRegistration<T>() would return null, even after that type was registered, when GetRegistration was called before that registration was made.
  • A call to GetService(Type) would return null instead of the registered service, when a call to GetRegistration was made before the registration was made.

New in Simple Injector 5.3.0 (Mar 4, 2021)

  • This minor release contains the following improvements and new features:
  • 897 Added a new convenient Container.GetTypesToRegister<T>(IEnumerable<Assembly>, TypesToRegisterOptions) overload.
  • 891 Container.GetRegistration<T>() failed with cast exception. This generic overload was added in v5.0, but almost never worked.
  • 863 Loosened up locking behavior of GetRegistration. A call to GetRegistration is now much less likely to cause the container to be locked. Thanks to @AroglDarthu for suggesting this.
  • 880 Allowed an existing Scope to be provided to a ScopedLifestyle to allow it to become the current active ambient scope. This feature was especially added for corner-case scenarios, such as Blazor integration.
  • 812 Improved exception messages caused by type initialization. TypeInitializationExcpetions, thrown by the .NET Framework are annoying and not very useful. When such exception is thrown while Simple Injector is resolving a type, Simple Injector will now transform the failure in a much more readable error message.
  • 864 Improved the message of the Disposable-Transient-Component diagnostic warning. Thanks to @AroglDarthu for suggesting this.

New in Simple Injector 5.2.1 (Jan 13, 2021)

  • Intermittently receiving IndexOutOfBoundsException from AsyncDisposableTypeCache.IsAsyncDisposable in 5.2.0

New in Simple Injector 5.2.0 (Dec 15, 2020)

  • This minor release implements the following work items:
  • Verification fails with IAsyncDisposable registrations
  • Prevent Microsoft.Bcl.AsyncInterfaces dependency

New in Simple Injector 5.1.0 (Oct 24, 2020)

  • This minor release adds two new features to the core library:
  • Collection.Append and Collection.Register can now be called while supplying both a lifestyle and open generic implementations.
  • DependencyMetadata<T> can now be used in conjunction with Flowing scopes.

New in Simple Injector 5.0.4 (Oct 15, 2020)

  • Conditional registrations can now be made when AllowOverridingRegistrations is set to true
  • Conditionally register instances of the same type can now be registered (thanks to @kwlin)
  • When calling Lifestyle.Singleton.CreateRegistration using a Func<object> delegate, C# overload resolution would cause the incorrect CreateRegistration overload to be called.

New in Simple Injector 5.0.3 (Aug 23, 2020)

  • 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.

New in Simple Injector 4.10.1 (Apr 25, 2020)

  • Improvements:
  • Simple Injector core library:
  • Added Container.Collection.Register overloads that accept a Lifestyle argument

New in Simple Injector 4.9.2 (Apr 8, 2020)

  • 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.

New in Simple Injector 4.9 (Jan 6, 2020)

  • 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 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)

New in Simple Injector 4.8.1 (Nov 30, 2019)

  • Simple Injector core library
  • #755 Improved a confusing Lifestyle Mismatch warning that went of when injecting a List<T> or array a Singleton.
  • #769 Fixed a false-positive Torn Lifestyle warning when using the forwarded collection registrations.

New in Simple Injector 2.6 (Oct 15, 2014)

  • Starting with Simple Injector 2.6 the Container.InjectProperties method has been marked as obsolete with the System.ObsoleteAttribute.
  • New features and improvements for the SimpleInjector.dll:
  • The RegisterAll method now allows registering open-generic types as well. (work item 20971)
  • New Container.Options.LifestyleSelectionBehavior extendibility point added to allow overriding the container's behavior to register type's with the Transient lifestyle. This is especially useful for batch-registration scenarios. (work item 20965)
  • The new DecoratorContext class can now be used as argument injected in a decorator's constructor that is registered using the RegisterDecorator extension methods to supply the decorator with specific information about its context. (work item 20959)
  • A new VisualizeObjectGraph method is added to the InstanceProducer class allow visualizing the object graph of an registration. This shows the complete object graph in a C#ish way. Feature also added in the debugger view. (work item 20954)
  • Container.GetRootRegistrations method added that allows retrieving all root registrations. The container debugger view now also shows root registrations. (work item 20955)
  • The RegisterManyForOpenGeneric extension method overloads added that allow supplying the AccessibilityOption enum are now also available in the PCL build. (work item 20396)
  • Prevented using dynamic assembly compilation after a certain threshold to prevent memory leaks. (work item 20961)
  • RegisterManyForOpenGeneric overloads now register all types by default (i.e. including internal types) instead of only public types. (work item 20964)
  • Container.InjectProperties has been made obsolete. (work item 20945)
  • Improved cyclic dependency detection. (work item 20969)
  • More expressive exception is thrown in case an open generic type is being resolved. (work item 20970)
  • Bug fixes for the SimpleInjector.dll:
  • Verification of Func delegates of decorators was sometimes skipped. (work item 20956)
  • New features and improvements for the SimpleInjector.Integration.Wcf.dll:
  • SimpleInjectorServiceBehavior class added to make it easier for users to create self-hosted WCF services. (work item 20898)
  • GetImplementedContracts method added to the SimpleInjectorServiceHost class to take it easier to add any custom behaviors to the implemented contracts.
  • Changes and bug fixes for the SimpleInjector.Integration.Wcf.dll:
  • RegisterMvcAttributeFilterProvider has been marked obsolete. (work item 20946)
  • Prevented the RegisterMvcAttributeFilterProvider from being called multiple times. (work item 20960)

New in Simple Injector 2.5.2 (Oct 15, 2014)

  • This patch release addresses the "JIT Compiler encountered an internal limitation" exception (see issue 20904) and adds a container.Options.EnableDynamicAssemblyCompilation property to allow suppressing dynamic assembly compilation to prevent issues caused by profiling tools such as the one described in issue 20677.

New in Simple Injector 2.5 (Oct 15, 2014)

  • New SimpleInjector.Extensions.ExecutionContextScoping.dll:
  • A new SimpleInjector.Extensions.ExecutionContextScoping.dll has been added. There is a separate NuGet package for this dll and you'll need .NET 4.5 or above for this package.
  • New SimpleInjector.Integration.WebApi.dll:
  • A new SimpleInjector.Integration.WebApi.dll has been added. There is a separate NuGet package for this dll and you'll need .NET 4.5 or above for this package.
  • There's also a convenient Quick Start NuGet package that helps you bootstrap your Web API application with Simple Injector in a matter of seconds.
  • New features and improvements for the SimpleInjector.dll:
  • New RegisterDecorator overload added that allows supplying a factory delegate for creating decorator types. 20550)
  • Design of the ScopedLifestyle class improved to make it easier to create custom lifestyles.
  • Performance improvements for ScopeLifestyle derivatives. Resolving the scope is now done once per compiled delegate and resolving an scoped instance from that scope is also done just once per compiled delegate. (work item 20641)
  • A call to Container.Verify will now ensure deterministic disposal of the scoped instances that are created during verification. (work item 20773)
  • Bug fixes for the SimpleInjector.dll:
  • Concurrency bug fixed in collections registered with RegisterAllOpenGeneric. (work item 20681)
  • Scoped lifestyles now allow resolving new instances while they are being disposed. Those resolved instances will be disposed as well.
  • Unregistered concrete types that were requested inside a singleton-registered delegate, were instantiated twice during a call to Container.Verify. (work item 20732)
  • Bug fixes and improvements for the SimpleInjector.Integration.Wcf.dll:
  • Removed the need to call EnablePerWcfOperationLifestyle.
  • Performance improved when Container.Verify was called.
  • Lifestyle now allow resolving new instances while they are being disposed. Those resolved instances will be disposed as well.
  • Improved performance resolving object graphs that contain instances that are registered per WCF operation. Resolving the scope is now done once per compiled delegate and resolving an scoped instance from that scope is also done just once per compiled delegate. (work item 20641)
  • Bug fixes and improvements for the SimpleInjector.Extensions.LifetimeScope.dll:
  • Removed the need to call EnableLifetimeScoping when lifetime scoping was used without any lifetime-scoped registrations.
  • Performance improved when Container.Verify was called.
  • Improved performance resolving object graphs that contain instances that are registered per Lifetime scope. Resolving the scope is now done once per compiled delegate and resolving an scoped instance from that scope is also done just once per compiled delegate. (work item 20641)
  • Bug fixes and improvements for the SimpleInjector.Integration.Web.dll:
  • Improved performance resolving object graphs that contain instances that are registered per web request. Resolving the scope is now done once per compiled delegate and resolving an scoped instance from that scope is also done just once per compiled delegate. (work item 20641)
  • Bug fixes and improvements for the SimpleInjector.Integration.Web.Mvc.dll:
  • New RegisterMvcIntegratedFilterProvider as a replacement for the old RegisterMvcAttributeFilterProvider. The RegisterMvcIntegratedFilterProvider allows better integration into the Simple Injector pipeline. The RegisterMvcAttributeFilterProvider will be made obsolete in a future version.

New in Simple Injector 2.4.1 (Oct 15, 2014)

  • New features and improvements for the SimpleInjector.dll:
  • Improved performance of calls to Verify() and lowered the memory consumption of the container caused by a call to Verify(). (work item 20083)
  • Verify now only creates instances that are root objects. This prevents users from having to write special case when extending the framework with methods such as RegisterWithContext.
  • Bug fixes for the SimpleInjector.dll:
  • Registering generic types using RegisterOpenGeneric and RegisterDecorator resulted in a stack overflow exception in case the generic type contained a type constraint that referred back to the type (a.k.a. the Curiously Recurring Template Pattern). (work item 20602)
  • Scoped lifestyles did not ensure that all instances where disposed. (work item 20579)
  • Bug fixes for the SimpleInjector.Integration.Wcf.dll:
  • WcfOperationLifestyle did not ensure that all instances where disposed. (work item 20579)
  • Bug fixes for the SimpleInjector.Integration.Web.dll:
  • WebRequestLifestyle did not ensure that all instances where disposed. (work item 20579)
  • Bug fixes for the SimpleInjector.Extensions.LifetimeScope.dll:
  • LifetimeScopeLifestyle did not ensure that all instances where disposed. (work item 20579)

New in Simple Injector 2.4 (Dec 14, 2013)

  • The two big new features for this minor release are the addition of a diagnostic API and support for Windows Phone 8 and Windows Store Apps.
  • New SimpleInjector.Diagnostics.dll:
  • A new SimpleInjector.Diagnostics.dll has been added. This dll is included in the core NuGet package.
  • The main entry point is the static Analyzer class.
  • New features and improvements for the SimpleInjector.dll
  • A ScopedLifestyle abstraction has been added to the core library. The existing scoped lifestyles now inherit from this base class. This allows the container registration to be oblivious to the actual scoped lifestyle implementation. The ScopedLifestyle class adds an WhenScopeEnds an RegisterForDisposal method that users can interact with. (work item 19969)
  • Collections that are registered using one of the RegisterAll overloads can now be injected and resolved as IReadOnlyCollection and IReadOnlyList (.NET 4.5 only). (work item 19992).
  • New RegisterOpenGeneric overloads have been added that allow passing in a predicate that allows determining on a per-type basis whether the registered implementation should be applied. just as can be done using RegisterDecorator. (work item 20284).
  • The RegisterOpenGeneric and RegisterDecorator extension methods now allow registering partial open generic types (Work item 19926).
  • Lifestyle.CreateProducer extension methods were added to make creating InstanceProducer instances easier. (work item 19959).
  • New Lifestyle.CreateHybrid method overload added that accepts two ScopedLifestyle instances and returns a hybrid ScopeLifestyle. (work item 19969)
  • RegisterAll(Type, params Registration) overload added to make registring collections using Registration instances easier. (work item 20001)
  • New convenient Lifestyle.CreateRegistration overloads added that allow supplying a single TConcrete type instead of TService and TImplementation.
  • New Container.RegisterInitializer overload added that allows supplying more information about the context of the created instance. (work item 19824).
  • Container.Register(Lifestyle) overload has been added. (Work item 20324).
  • InstanceProducer.GetRelationships() method added to allow analyzing a registration's dependencies (Work item 20235).
  • Bug fixes for the SimpleInjector.dll:
  • Scoped lifestyles disposed instances in the wrong order. (work item 20100).
  • Not all created registrations ended up in the debugger diagnostics view. (work item 19954).
  • Visual Basic debugger didn't display debug information. Although fixed, the experience still sucks for VB developers, but at least they can view the information now. (work item 20271)
  • Exception messages often contained the text "No registration for type {0} could be found " even though the type was registered explicitly. (work item 20272).
  • A call to RegisterOpenGeneric could fail because it would try to apply an incompatible implementation, because the generic type constraints weren't always validated correctly.
  • Registration of variant types with RegisterAll failed (Work item 20366).
  • In special cases where one of the registered types in a RegisterAll registration would be an abstract type (which points back to the container), the ExpressionBuilt event wasn't triggered for this abstract type and a decorator for this abstraction would not be applied (only the decorator for the collection type would be applied) (Work item 20367).
  • Bug fixes for the SimpleInjector.Integration.Wcf.dll:
  • WcfOperationLifestyle disposed instances in the wrong order. (work item 20100).
  • Bug fixes for the SimpleInjector.Integration.Web.dll:
  • WebRequestLifestyle disposed instances in the wrong order. (work item 20100).
  • Bug fixes for the SimpleInjector.Extensions.LifetimeScope.dll:
  • LifetimeScope disposed instances in the wrong order. (work item 20100).

New in Simple Injector 2.3.6 (Oct 22, 2013)

  • This patch releases fixes one bug concerning resolving open generic types that contain nested generic type arguments. Nested generic types were handled incorrectly in certain cases. This affects RegisterOpenGeneric and RegisterDecorator. (work item 20332)

New in Simple Injector 2.3.5 (Sep 3, 2013)

  • Bug fixes for the SImpleInjector.Extensions.LifetimeScoping.dll:
  • Using Lifetime scoping in combination with RegisterOpenGeneric could result in a confusion error message, hiding the fact the EnableLifetimeScoping() should be called.

New in Simple Injector 2.3.4 (Sep 2, 2013)

  • Bug fixes for the SimpleInjector.dll:
  • Diagnostic Services incorrectly reported a potential lifetime mismatch warning when a singleton decorator depended on a Func where T was the decorated type. (work item 20141)
  • Calls to GetRegistration did not throw an exception that was as expressive as call to GetInstance. (work item 20155)
  • Improved the exception message when a decorator registration is done with a type that can not be used as decorator. (work item 20047)
  • Bug fixes for the SimpleInjector.Integration.Web.Mvc.dll:
  • The SimpleInjectorDependencyResolver would now throw a descriptive exception when an unregistered controller couldn't be created (for whatever reason) instead of allowing null to be returned, since this causes MVC to throw a non-descriptive "Make sure that the controller has a parameterless public constructor" exception, hiding the real cause. (work item 20097)
  • Bug fixes for the SimpleInjector.Extensions.LifetimeScoping.dll:
  • Using an open generic type (registered using RegisterOpenGeneric) failed when registered with a LifetimeScopeLifestyle that wasn't used for other registrations. (work item 20162)

New in Simple Injector 2.3.1 (Jul 13, 2013)

  • Bug fixes for the SimpleInjector.Integration.Wcf.dll:
  • Lifetime scope was not disposed when object graph construction failed. (work item 19948)
  • WCF Integration broke WS-Discovery. (work item 19960)
  • Instances where cached per service type instead of per registration. (work item 19947)
  • Bug fixes for the SimpleInjector.Extensions.LifetimeScoping.dll:
  • Instances where cached per service type instead of per registration. (work item 19947)

New in Simple Injector 2.3.0 (Jul 1, 2013)

  • New features and improvements for the SimpleInjector.dll:
  • RegisterManyForOpenGeneric overload that take in an BatchRegistrationCallback and a list of types now accept open generic types. Closed generic versions of the supplied open generic types will added to the list of implementations that is supplied to the BatchRegistrationCallback. This allows making collections with a mixed of generic and non-generic types. (work item 19745)
  • RegisterAllOpenGeneric extension methods added. RegisterAllOpenGeneric does to collections what RegisterOpenGeneric does to normal registrations. RegisterAllOpenGeneric allows registering a list of open generic types which will be tranformed to a list of matching closed generic types when a collection is requested. (work item 19758)
  • New RegisterAll overload added that accepts a collection of Registration instances. This makes registering collections more consistent. (work item 19876)
  • A new AppendToCollection extension method has been added to the AdvancedExtensions class in the SimpleInjector.Advanced namespace to make integration with frameworks such as NServiceBus and ReactiveUI easier. The method allows appending new registrations to existing registrations made using one of the RegisterAll overloads. (work item 19771)
  • Changes for the SimpleInjector.dll:
  • Func decoratee dependencies in decorators are now verified when calling container.Verify(). (work item 19851)
  • Registrations of collections are now generated and compiled more lazily which improves start-up performance when items are retrieved by index in large collections. (work item 19601)
  • Bug fixes for the SimpleInjector.dll:
  • Adding KnownRelationship instances during ExpressionBuilt would leak to other InstanceProducer instances when they shared the same Registration. This resulted in false warnings in the Diagnostic Services. (work item 19796)
  • The RegisterDecorator method overload that accepts the predicate didn't supply the correct DecoratorPredicateContext when decorating multiple registrations with the same service type. The internal cache used the service type as key, not the InstanceProducer. (work item 19780)
  • The framework shows user friendly (C# like) type names in exception messages, but it failed to do so when displaying a type that was an array of generic types. In that case a FormatException was thrown hiding the real exception. (work item 19847)
  • Resolving an externally provided singleton (using RegisterSingle(TService)) failed when the supplied instance was a subtype of TService and contained a property that was configured to be injected. (work item 19880)
  • RegisterInitializer behaved inconsistent between singleton registrations with a delegate and an instance. The supplied instance would get the delegate applied, while the instance returned from the delegate didn't. (work item 19881)
  • Bug fixes for the SimpleInjector.Integration.Wcf.dll:
  • For some WCF configurations, the container would throw an InvalidOperationException with the message "WCF scopes can not be nested.". (work item 19866)
  • Project changes:
  • Silverlight NuGet packages are now merged with .NET packages. The separate Silverlight packages still exist, but will be deprecated soon. (work item 19764)

New in Simple Injector 2.2.3 (May 7, 2013)

  • Improvements and internal changes for the SimpleInjector.dll:
  • ResolveUnregisteredType event was triggered more often than needed, which had a negative impact on performance.
  • Bug fixes for the SimpleInjector.dll:
  • Use of ResolveUnregisteredType event (which is primarily consumed by the RegisterOpenGeneric extension methods) could lead to incorrect 'Single Responsibility Violation' warnings in the Debugger Diagnostic view. (work item 19670)

New in Simple Injector 2.2.1 (Apr 22, 2013)

  • Improvements and internal changes for the SimpleInjector.dll:
  • When a collection is registered using RegisterAll(T), RegisterAll(Type), RegisterAll(IEnumerable) or RegisterAll(Type, IEnumerable), retrieving that instance using the generic GetAllInstances() will now return a collection that implements IList. This allows retrieving elements by index with an performance characteristic of O(1). Collections decorated using the RegisterDecorator overloads will maintain this behavior. Note that this is not supported when retrieving instances using GetAllInstances(Type). (work item 19575)
  • Each container instance now uses a single dynamic assembly for delegate compilation. This used to be one generic assembly per compiled delegate, but this has much more overhead.
  • Bug fixes for the SimpleInjector.dll:
  • Container.Verify() only checked the original registration of collections and not whether the final collection (that could be intercepted and decorated) worked as expected. (work item 19596)
  • The RegisterAll(TService) overload that takes in an array of singleton instances, did not let those instances go through the pipeline as would happen when registering a singleton instance using Register(TService). With the latter method properties and possible other transformations would be applied, while the former only called the initializer delegates. (work item 19576)
  • Registering a collection using RegisterAll(Type) failed when one of the supplied types was an interface incorrectly stating the the interface did not inherit from System.Object. (work item 19577)
  • New features in Integration.Web.Mvc.dll:
  • New SimpleInjectorMvcExtensions.GetControllerTypesToRegister method added. This allows users to change the way MVC controllers are registered by default (using the RegisterMvcControllers overload).

New in Simple Injector 2.2 (Apr 9, 2013)

  • New features and improvements:
  • Registration.InitializeInstance(object) method added to allow initializing instances that can't be created by the container, but need to be initialized according to the container's configuration. (work item 19502)
  • InstanceProducer.Registration property added to allow accessing the InstanceProducer's Registration instance.
  • Bug fixes:
  • Properties where not injected when a single instance was registered using RegisterSingle(T), although any initializers (registered through RegisterInitializer(Action)) did fire. (work item 19513)
  • A NullReferenceException would be thrown by the container, when a Func registration was called that returned null combined with the injection of one or more properties for that type. (work item 19526)
  • The exception thrown by the container when one of the type's properties couldn't be resolved, did not describe the name of the property.
  • RegisterSingleOpenGeneric and RegisterOpenGeneric with custom lifestyle didn't work correctly when the registration was made with the same type for both the service and implementation type. This made the container fall back to resolving a transient type instead. (work item 19570).

New in Simple Injector 2.1 (Apr 1, 2013)

  • This minor release adds two new features:
  • A new extension point has been added that makes it considerably easier to auto-wire properties;
  • A new diagnostic warning has been added that searches the configuration for components with too many dependencies, because they can cause maintainability issues.

New in Simple Injector 2.0.1 (Mar 1, 2013)

  • Bug fixes for the SimpleInjector.dll:
  • Decorating empty (unregistered) collections failed when the decorator had a lifestyle different than transient or singleton. (work item 19400)
  • When RegisterManyForOpenGeneric registered implementations that implemented multiple closed generic versions of the supplied generic interface, each closed-generic interface got its own registration, which had the effect of still returning more than one instance of that implementation within the registered lifestyle. (work item 19384).
  • Custom KnownDependency instances that where added during the interception (ExpressionBuilding event) of a decorator type (RegisterDecorator) where not added to the decorated registration. (work item 19391)
  • Bug fixes for the WCF integration packages:
  • SimpleInjectorServiceHostFactory.SetContainer called container.EnablePerWcfOperationLifestyle() which locked the container and failed when the container was already locked.
  • EnablePerWcfOperationLifestyle has been made an extension method.
  • WCF Integration Quick Start NuGet package contained quick start code that failed when ran.

New in Simple Injector 1.6.1 (Dec 12, 2012)

  • This patch release fixes a bug in the integration libraries that disallowed the application to start when .NET 4.5 was not installed on the machine (but only .NET 4.0).
  • The following packages are affected:
  • SimpleInjector.Integration.Web.dll
  • SimpleInjector.Integration.Web.Mvc.dll
  • SimpleInjector.Integration.Wcf.dll
  • SimpleInjector.Extensions.LifetimeScoping.dll

New in Simple Injector 1.6.0 (Nov 15, 2012)

  • Bug fixes in this release for the SimpleInjector.dll:
  • Calling GetService(Type) and GetRegistration(Type) with type being IEnumerable failed instead of returning null.
  • Injecting properties could fail under .NET 4.0 and up under certain specific conditions. (work item 18909)
  • Building a friendly name for an exception message failed for types nested in a generic type. The original error was lost.
  • GetInstance(Type) threw a less expressive exception as GetInstance() when a type could not be resolved. (work item 18542)
  • Bug fixes in this release for the SimpleInjector.Extensions.dll:
  • RegisterOpenGeneric allowed registering types that could never be resolved (for instance when they had multiple constructors). An ArgumentException is now thrown during registration.
  • An implementation type registered using RegisterOpenGeneric that could not be resolved (because for instance it has unregistered dependencies) caused a NullReferenceException.
  • Changes in this release for the SimpleInjector.Integration.Web.dll:
  • A new PerWebRequestInstanceCreator type has been added to allow making it easier to register generic types (registered using RegisterOpenGeneric or RegisterDecorator) with the Per Web Request lifetime.
  • An exception is thrown when a Per Web Request registered instance is requested outside the context of a HTTP request (when HttpContext.Current is null). The previous release returned a transient, but this would easily lead to hard to track errors and is hardly ever the behavior the user needs.
  • Changes in this release for the SimpleInjector.Extensions.LifetimeScoping.dll:
  • An exception is thrown when a Per Lifetime Scope registered instance is requested outside the context of a lifetime scope. The previous release returned a singleton, but this would easily lead to hard to track errors. This was hardly ever the behavior the user needs.
  • Bug fixes in this release for the SimpleInjector.Integration.Wcf.dll:
  • Registrations made using BeginWcfOperationScope can now be tested using Container.Verify.

New in Simple Injector 1.5.0 (Jul 17, 2012)

  • New features and improvements in this release for the SimpleInjector.dll:
  • Extension points added in the form of ContainerOptions.ConstructorXXXBehavior, which allows developers to override the behavior of constructor resolution and injection. (work item 18097)
  • Container.Options property has been added, to allow easy access to the ContainerOptions instance.
  • Bug fixes in this release for the SimpleInjector.dll:
  • Container did not self-register when created with Container(ContainerOptions) constructor. (work item 18139)
  • New features and improvements in this release for the SimpleInjector.Extensions.dll:
  • RegisterDecorator extension methods now allow injecting Func delegates. This enables some interesting advanced scenarios where the creation of the decorated instance should be delayed. (work item 18211). Read the updated Decorator wiki page for more information.
  • RegisterSingleDecorator overloads added. These overloads are especially useful when injecting Func delegates into decorators.
  • When collections are registered using RegisterAll overloads that either take a list of System.Type instances or a array of singletons (so not with RegisterAll(IEnumerable)), the predicate supplied to RegisterDecorator will be called on each item in the collection, instead of being called once for the complete collection. This allows individual items to be decorated while skipping others.
  • The extension methods Register(this Container, Type service, Type implementation) and RegisterSingle(this Container, Type service, Type implementation) now allow supplying the same type for service and implementation, which registers the type by itself. (work item 18234)
  • Bug fixes in this release for the SimpleInjector.Extensions.dll:
  • RegisterAll did not allow registering a service type that equaled the registered service type, for instance container.RegisterAll(new[] { typeof(IService) }) failed.
  • Conditional decoration (using the Predicate) fixed for decorating items in collections. The predicate was not checked on collections.
  • When registering decorators, the IEnumerable type was supplied to the Predicatethrough the ServiceType property, instead of the service type itself when decorating collections.

New in Simple Injector 1.4.0 (Feb 21, 2012)

  • SimpleInjector.dll:
  • A new GetInitializer method has been added to the container, to allow retrieving an Action delegate -for a given T- that, when called, calls all delegates that are registered using the RegisterInitializer, and apply to that given T. This enables some advanced scenarios. The RegisterManyForOpenGeneric method of the SimpleInjector.Extensions.dll makes use of this new GetInitializer method.
  • Bug fix:
  • The exception message that was thrown in case the delegate of a type could not be compiled, incorrectly described the UnregisteredTypeEventArgs.Register method, which was confusing and misleading.
  • SimpleInjector.Extensions.dll:
  • Decorators created using the RegisterManyForOpenGeneric extension methods now get initialized by all applicable initializers (if any).