Simple Injector v4.0

@dotnetjunkie dotnetjunkie released this Mar 31, 2017 · 36 commits to v4.0.x since this release

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 v3.0, please make sure you upgrade your application to the latest 2.8 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)

Downloads

Simple Injector v3.3.1

@dotnetjunkie dotnetjunkie released this Nov 23, 2016 · 2 commits to v3.3.x since this release

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.

Downloads

Simple Injector v3.3

@dotnetjunkie dotnetjunkie released this Nov 21, 2016 · 3 commits to v3.3.x since this release

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)

Downloads

Simple Injector v3.2.3

@dotnetjunkie dotnetjunkie released this Oct 16, 2016 · 5 commits to v3.2.x since this release

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.2.3 is a patch release that contains one bug fix.

Fixes and improvements for the SimpleInjector.dll

  • Resolving generic type with type argument that maps to multiple concrete types of other type argument failed (fixes #316)

You can download Simple Injector from NuGet.

Downloads

Simple Injector v3.2.2

@dotnetjunkie dotnetjunkie released this Aug 26, 2016 · 11 commits to v3.2.x since this release

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.2.2 is a patch release that contains two bug fixes.

Fixes and improvements for the SimpleInjector.dll

  • Simple Injector core library is now compatible with .NETStandard 1.0 which allows it to run with Xamarin.Android and MonoDroid (fixes #262 and #263).
  • Working with IReadOnlyCollection and IReadOnlyList failed with the .NET Core and .NETStandard compatible version (fixes #289).

Fixes and improvements for the SimpleInjector.Extensions.LifetimeScoping.dll

  • Library is now compatible with .NETStandard 1.0.

Fixes and improvements for the SimpleInjector.Extensions.ExecutionContextScoping.dll

  • Library is now compatible with .NETStandard 1.3.

You can download Simple Injector from NuGet.

Downloads

Simple Injector v3.2

@dotnetjunkie dotnetjunkie released this Jun 28, 2016 · 273 commits to master since this release

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 v3.2 contains two main features and several smaller improvements.

  1. The most prominent feature is the compatibility with .NET Core v1 RTM. We are glad that the moving target has stopped moving :)
  2. Besides that, Simple Injector now has a simplified model for developers that work with platforms that lack proper ambient contexts (like Windows RT). Historically, Simple Injector always depended on ambient contexts such as HttpContext, WCF scoping, and things like AsyncLocal and ThreadLocal to do its scoping. Platforms like RT are truly asynchronous, but currently lack a proper async ambient context. Simple Injector v3.2 now allows resolving directly from the Scope object, and allows injecting Scope instances into constructors of components. This prevents going through hoops to get Simple Injector working in those types of applications. We will add a new page to our documentation that explains how to use this. Of course we still support our normal model, and for most application types, our advice is to keep using this model.

New features and improvements for the SimpleInjector.dll

  • Compatibility with .NET Core RTM.
  • Simplified working with Simple Injector on platforms without ambient context. (fixes #226)
  • Added configuration switch that makes Simple Injector output fully qualified type information in exception messages. (fixes #182)
  • Changes Lifestyle.CreateProducer<TService>(Func<TService>, Container) to return InstanceProducer<T> instead of InstanceProducer. (fixes #244)
  • Add Container.GetOrSetItem extension method to make it easier to atomically get and set items from the items dictionary. (fixes #231)
  • Prevented first change exceptions in several occasions. (#230 and #242)

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

  • NuGet package noww references Microsoft.Web.Mvc NuGet package instead of GAC version. (fixes #218)

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

  • Allowed WCF services to be resolved as interfaces. (fixes #220)

Downloads

Simple Injector v3.1.4

@dotnetjunkie dotnetjunkie released this May 1, 2016 · 5 commits to v3.1.x since this release

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.1.4 is a patch release that contains one bug fix.

Fixes and improvements for the SimpleInjector.dll

  • Torn lifestyle was invalidly thrown when multiple InstanceProducers for the same service type where wrapped with multiple decorators. (fixes #228)

You can download Simple Injector from NuGet.

Downloads

Simple Injector v3.1.3

@dotnetjunkie dotnetjunkie released this Apr 12, 2016 · 7 commits to v3.1.x since this release

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.1.3 is a patch release that contains several small improvements and bug fixes to both the core library and some of the integration libraries.

Fixes and improvements for the SimpleInjector.dll

  • Conditional registration for closed-generic types replaced earlier registrations instead of being appended. (fixes #186)
  • Mixing conditional and unconditional registrations for same closed-generic type did not fail at registration time. (fixes #217)
  • Registration of conditional closed-generic types prevented when container allows overriding registrations. (fixes #216)
  • Improved exception message when resolving unregistered collections. (fixes #204)
  • URL to documentation added to "container can't be changed" exception message. (fixes #177)

Fixes and improvements for the SimpleInjector.Integration.Wcf.dll

  • WCF integration failed to create WCF services marked with InstanceContextMode.Single. (fixes #197)

Fixes and improvements for the SimpleInjector.Integration.Web.dll

  • SimpleInjector.Integration.Web NuGet package now references the Microsoft.Web.Infrastructure NuGet package instead of the Microsoft.Web.Infrastructure.dll from the GAC. (fixes #170)

Downloads

Simple Injector v3.1.2

@dotnetjunkie dotnetjunkie released this Dec 14, 2015 · 55 commits to v3.1.x since this release

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.1.2 is a patch release that fixes two small issues with scoping and adds support for DNXCORE50/CoreCLR.

Fixes and improvements for the SimpleInjector.dll

  • Memory usage of Scope instances reduced after scope is disposed. (fixes #160)
  • DNXCORE50/CoreCLR version available. (fixes #57)

Fixes and improvements for the SimpleInjector.Extensions.ExecutionContextScoping.dll

  • GetCurrentExecutionContextScope() will never return disposed scopes anymore. (fixes #159)
  • DNXCORE50/CoreCLR version available. (fixes #57)

Fixes and improvements for the SimpleInjector.Extensions.LifetimeScoping.dll

  • GetCurrentLifetimeScope() will never return disposed scopes anymore. (fixes #159)
  • DNXCORE50/CoreCLR version available. (fixes #57)

Downloads

Simple Injector v3.1.1

@dotnetjunkie dotnetjunkie released this Nov 23, 2015 · 76 commits to v3.1.x since this release

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.1.1 is a patch release that fixes two bugs in the core library, one memory leak fix and one related to the diagnostic system.

Bug #135 caused a Container instance to keep rooted, and thus prevented the container and all its dependent object from being collected by the GC, in case decorators where applied. This causes a memory leak in applications that create an undefined number of container instances during the lifetime of the application. Do note that in case you are creating many container instances throughout the lifetime of the application, you should call Container.Dispose to prevent the memory leak.

Bug #140 prevented the container from detecting an Lifestyle Mismatch in an object graph when calling GetInstance. The problem only appeared in case Verify() was not called, or when objects were resolved that were not registered explicitly (or were registered as open-generic type, while not being referenced as closed-generic type by other registered types). Do note that this bug fix might cause an exception to be thrown in applications that seem to run correctly in v3.1.0, because the Lifestyle Mismatch was not detected before.

Downloads