Skip to content

Releases: simpleinjector/SimpleInjector

Simple Injector v4.3

16 May 15:37
Compare
Choose a tag to compare

Release Notes

This release can be downloaded using NuGet.

The major theme of this release is to improve usability by introducing new overloads to existing registration methods and by grouping all the collection registration methods.

The grouping of collection registration methods was started in release v4.1 and had to be done gradually from minor release to minor release to prevent having too many changes at once for existing users. This release ends this refactoring phase; all methods concerning the creation, appending and registration of collections are now available by calling container.Collection., e.g. container.Collection.Register.

Overloads have been added to Collection.Create, Collection.Append, Collection.Register and GetTypesToRegister to make it easier to work with these methods. Among other things, this included the addition of generic methods and methods containing a params array.

Features and improvements

Simple Injector core library

  • #548 Added Collection.Create(params Assembly[]) and Collection.CreateRegistration(params Assembly[]) overloads
  • #547 Renamed Collection.AppendTo to Collection.Append. Old methods marked [Obsolete].
  • #546 Added Collection.Append<TService, TImplementation>() overload.
  • #552 Added RegisterConditional<TService>(Registration, Predicate<PredicateContext>) overload.
  • #551 Added GetTypesToRegister overloads.
  • #541 Renamed RegisterCollection overloads to Collection.Register. Old methods are marked [Obsolete].
  • #542 Added `Collection.Register(params) overloads.
  • #556 Renamed Container.Collections to Container.Collection. Old property marked [Obsolete].

Simple Injector v4.2.3

15 May 17:16
Compare
Choose a tag to compare

Release Notes

Simple Injector can be downloaded using NuGet.

Bug fixes

Simple Injector core library

  • Container.Collections renamed to Container.Collection. #556.

Simple Injector v4.1.3

15 May 17:16
Compare
Choose a tag to compare

Release Notes

Simple Injector can be downloaded using NuGet.

Bug fixes

Simple Injector core library

  • Container.Collections renamed to Container.Collection. #556.

Simple Injector v4.2.2

27 Apr 08:44
Compare
Choose a tag to compare

Release Notes

Simple Injector can be downloaded using NuGet.

Bug fixes

Simple Injector core library

  • Calling RegisterDecorator on short-lived containers causes memory-leak #532

Simple Injector v4.1.2

27 Apr 08:44
Compare
Choose a tag to compare

Release Notes

Simple Injector can be downloaded using NuGet.

Bug fixes

Simple Injector core library

  • Calling RegisterDecorator on short-lived containers causes memory-leak #532

Simple Injector v4.2

15 Apr 08:08
Compare
Choose a tag to compare

Release Notes

Simple Injector v4.2 can be downloaded using NuGet.

Features and improvements

Simple Injector core library

  • Reintroduction of ambient-less scoping #532

Simple Injector v4.1

23 Mar 20:38
Compare
Choose a tag to compare

Release Notes

Simple Injector v4.1 can be downloaded using NuGet.

This release contains several smaller improvements and bug fixes to the core library and its integration packages. Most prominent changes are:

  • In our constant effort to improve the API, we obsoleted some methods and replaced them with other methods with the same behavior:
    • Container.RegisterSingleton(T) became Container.RegisterInstance(T)
    • Container.RegisterSingleton(Type, object) became Container.RegisterInstance(Type, object)
    • AdvancedExtensions.AppendToCollection overloads became Container.Collections.AppendTo
    • The WcfOperationLifestyle became obsolete. AsyncScopedLifestyle should be used instead.
  • The WCF Integration package is now compatible with the new async/await paradigm, which allows you to make your WCF service methods asynchronous. This requires the use of AsyncScopedLifestyle, and as a consequence, the integration package is now only compatible with .NET 4.5 and up.
  • Two improvements in the ASP.NET Core integration library simplify cross-wiring and the addition of middleware. These packages now require ASP.NET Core 2.0 or up.

Features and improvements

Simple Injector core library

  • RegisterSingleton(T) and RegisterSingleton(Type, object) overloads renamed to RegisterInstance #469
  • Overloads added to Container.Register and Container.RegisterSingleton to simplify batch-registration on a single assembly #486
  • Allow created disposable instances to be retrieved from their Scope #478
  • Simplified working with subsets of collections #517

SimpleInjector.Integration.AspNetCore

  • UseMiddleware(Container) extension method added to ASP.NET Core integration package to simplify adding middleware #513
  • Simplified cross-wiring by introducing a new AutoCrossWireAspNetComponents() extension method #442

SimpleInjector.Integration.Wcf

  • SimpleInjector.Integration.Wcf now supports async WCF service methods #447

Bug fixes

Simple Injector core library

  • Decorator registration didn't check whether supplied type contained generic type parameters, making the registration fail silently #394
  • RegisterDecorator overload that accepts lifestyle was missing generic constraints #499

Simple Injector v4.0

31 Mar 06:25
Compare
Choose a tag to compare

Release Notes

Simple Injector v4 is available through Nuget. For more background information about this release and a general overview, please read the blog post.

Before you upgrade to v4.0, please make sure you upgrade your application to the latest 3.x version of Simple Injector first.

Features and improvements

Simple Injector core library

  • ThreadScopedLifestyle added to core library as replacement of LifetimeScopeLifestyle. This is purely a name change, it behaves identical to the old LifetimeScopeLifestyle. The SimpleInjector.Extensions.LifestyleScoping package has been deprecated. (fixes #299)

  • AsyncScopedLifestyle added to core library as replacement of ExecutionContextScopeLifestyle. This is purely a name change, it behaves identical to the old ExecutionContextScopeLifestyle. The SimpleInjector.Extensions.ExecutionContextScoping package has been deprecated. (fixes #299)

  • TypesExtensions class added with useful extension methods on Type: ToFriendlyName,
    IsClosedTypeOf, GetClosedTypeOf and GetClosedTypesOf methods. (fixes #358)

  • Container.AddRegistration(Registration) method added. (fixes #367)

  • Lifestyle.CreateHybrid overloads added for ScopedLifestyles that remove the need to supply
    an lifestyleSelector delegate. (fixes #341)

  • InstanceProducer.FromExpression() added to simplify wrapping Expression instances. (fixes #346)

  • Stack trace added to exception that gets thrown when container got disposed. (fixes #368)

  • Clear exception is thrown when invalid Expression is passed on to
    ExpressionBuildingEventArgs.Expression. (fixes #354)

  • Improved exception message when registering generic types with type constraints while in
    overriding mode. (fixes #384)

  • Improved exception message thrown when RegisterCollection is called twice. (fixes #378)

SimpleInjector.Integration.AspNetCore

  • GetRequestService and GetRequiredRequestService extension methods added for IApplicationBuilder to simplify resolving instances from the ASP.NET configuration system, while
    their lifestyle is preserved. See the ASP.NET Core integration guide for more information.

SimpleInjector.Packaging

  • GetPackagesToRegister extension method added to simplify retrieving packages.

Breaking changes

Simple Injector core library

  • Registration instances will now get cached to prevent torn lifestyles. (fixes #219)

  • Short Circuited Dependency warning will now go off as well for transient registrations. (fixes #248)

  • Container.RegisterInitializer(Action<InstanceInitializationData>, Predicate<InitializationContext>)
    replaced with RegisterInitializer(Action<InstanceInitializationData>, Predicate<InitializerContext>)
    method. (fixes #348)

  • IConstructorResolutionBehavior.GetConstructor(Type, Type) signature changed to
    GetConstructor(Type). (fixes #345)

  • ILifestyleSelectionBehavior.SelectLifestyle(Type, Type) signature changed to
    SelectLifestyle(Type). (fixes #345)

  • IDependencyInjectionBehavior.BuildExpression method replace with
    GetInstanceProducer(InjectionConsumerInfo, bool) that returns an InstanceProducer (fixes #346)

  • IPropertySelectionBehavior.SelectProperty(Type serviceType, PropertyInfo) replaced with
    SelectProperty(Type implementationType, PropertyInfo) method. (fixes #348)

  • Lifestyle.CreateRegistration<TService, TImplementation>(Container) signature changes to CreateRegistration(Container). (fixes #345)

  • Lifestyle.CreateRegistration(Type, Type, Container) signature changes to
    CreateRegistration(Type, Container). (fixed #345)

  • Lifestyle.CreateRegistrationCore<TService, TImplementation>(Container) signature changes to
    CreateRegistrationCore(Container). (fixes #345)

  • Lifestyle.Length property made public to simplify creating custom lifestyles. (fixes #245)

  • ExpressionBuildingEventArgs.RegisteredServiceType removed. (fixes #348)

  • InjectionConsumerInfo.ServiceType removed. (fixes #348)

  • Registration.BuildTransientExpression<TService, TImplementation>() signature changed to
    BuildTransientExpression(). (fixes #345)

  • Registration.BuildTransientDelegate<TService, TImplementation>() signature changed to
    BuildTransientDelegate(). (fixes #345 / #348)

SimpleInjector.Extensions.LifetimeScoping

SimpleInjector.Extensions.ExecutionContextScoping

  • This package has been deprecated and will no longer be maintained. All functionality has been merged into the core library. (fixes #299)
  • ExecutionContextScopeLifestyle has been deprecated. Users should use the new SimpleInjector.Lifestyles.AsyncScopedLifestyle. (fixes #299)

SimpleInjector.Integration.AspNetCore

  • AspNetRequestLifestyle has been deprecated. Users should use the new SimpleInjector.Lifestyles.AsyncScopedLifestyle.
  • UseSimpleInjectorAspNetRequestScoping extension method for IApplicationBuilder has been deprecated. Users should now use the overload for IServiceCollection instead. See the integration guide for more information.

SimpleInjector.Integration.Wcf

  • SimpleInjectorWcfExtensions methods that were deprecated in v3 have now been removed completely. (fixes #305)
  • SimpleInjectorWcfExtensions.RegisterPerWcfOperation marked obsolete.
  • WcfOperationLifestyle methods that were deprecated in v3 have now been removed completely. (fixes #326)
  • RegisterPerWcfOperation and GetCurrentWcfOperationScope marked with Obsolete(true) causing them to trigger. (fixes #304)

SimpleInjector.Integration.Web

  • SimpleInjectorWebExtensions and WebRequestLifestyle methods that were deprecated in v3 have now been removed completely. (fixes #326)
  • RegisterPerWebRequest marked with Obsolete(true). (fixes #304)

SimpleInjector.Integration.Web.Mvc

  • SimpleInjectorMvcExtensions methods that were deprecated in v3 have now been removed completely. (fixes #305)

SimpleInjector.Integration.WebApi

SimpleInjector.Packaging

  • RegisterPackages(Container) method marked obsolete. The overload that accepts a list of Assembly instances should be used instead. (fixes #372)

Bug fixes

  • Prevented RegisterConditional predicates from always being called twice. (fixes #346)
  • Allowed properties to be injected on conditional registrations, in case custom property injection behavior is applied. (fixes #383)
  • Open-generic abstractions with a "new()" type constraint would be incorrectly flagged as
    conditional, making it impossible to replace those registrations. (fixes #387)

Simple Injector v3.3.1

23 Nov 21:20
Compare
Choose a tag to compare

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 before upgrading to v3.x.

Simple Injector v.3.3.1 is a patch release that contains one bug fix.

Fixes and improvements for the SimpleInjector.dll

  • PredicateContext.Consumer.ServiceType property contained incorrect value when the parent/consumer of a conditional registration was an open-generic registration.(fixes #333)

You can download Simple Injector from NuGet.

Simple Injector v3.3

21 Nov 19:49
Compare
Choose a tag to compare

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 before upgrading to v3.x.

The most prominent changes in Simple Injector v3.3 are the addition of the Container.Options.DefaultLifestyle property to simplify changing the default lifestyle and the deprecation of old API that will be removed in v4.

Please goto NuGet to download this release.

New features and improvements for the SimpleInjector.dll

  • Added ContainerOptions.DefaultLifestyle property to make it easier to override the default (transient) lifestyle. (fixes #313)
  • Improved error message in case a registration couldn't be resolved caused by incorrect dynamic assembly loading. (fixes #325)
  • Marked ContainerOptions.ResolveUnregisteredCollections obsolete. (fixes #303)
  • Removed unneeded dependencies in .NETStandard NuGet release. (fixes #312)

New features and improvements for the SimpleInjector.Integration.Web.dll

  • Marked RegisterPerWebRequest extension method obsolete. (fixes #303)

New features and improvements for the SimpleInjector.Integration.Wcf.dll

  • Marked RegisterPerWcfOperation and GetCurrentWcfOperationScope methods obsolete. (fixes #303)
  • Marked WcfOperationLifestyle ctor overloads that allow controlling disposal obsolete. (fixes #307)
  • Marked WebRequestLifestyle ctor overloads that allow controlling disposal obsolete. (fixes #307)

New features and improvements for the SimpleInjector.Extensions.LifetimeScoping.dll

  • Marked RegisterLifetimeScope and GetCurrentLifetimeScope methods obsolete. (fixes #303)
  • Marked LifetimeScopeLifestyle ctor overloads that allow controlling disposal obsolete. (fixes #307)

New features and improvements for the SimpleInjector.Integration.WebApi.dll

  • Marked RegisterWebApiRequest method obsolete. (fixes #303)
  • Marked WebApiRequestLifestyle ctor overloads that allow controlling disposal obsolete. (fixes #307)

New features and improvements for the SimpleInjector.Extensions.ExecutionContextScoping.dll

  • Marked ExecutionContextScopeLifestyle ctor overloads that allow controlling disposal obsolete. (fixes #307)