Skip to content

@dotnetjunkie dotnetjunkie released this Oct 24, 2020 · 3 commits to v5.1.x since this release

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 and Collection.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.

Assets 2

@dotnetjunkie dotnetjunkie released this Oct 15, 2020 · 6 commits to v5.0.x since this release

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 a Func<object> delegate, C# overload resolution would cause the incorrect CreateRegistration overload to be called.
Assets 2

@dotnetjunkie dotnetjunkie released this Aug 22, 2020 · 8 commits to v5.0.x since this release

Simple Injector v5.0.3 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 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.

Assets 2

@dotnetjunkie dotnetjunkie released this Jun 28, 2020 · 9 commits to v5.0.x since this release

Simple Injector v5.0.2 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 issue #829 and allows collections with Scoped dependencies be resolved from a Scope when the 'Flowing' scoping model is used.

Assets 2
Jun 28, 2020
Allowed collections containing Scoped components to be resolved from …
…Scope while the application uses Flowing/Closure model. Fixes #829

@dotnetjunkie dotnetjunkie released this Jun 11, 2020 · 17 commits to v5.0.x since this release

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.

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.

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 allows Transient 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 and Scope classes now implement IAsyncDisposable 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 setting Container.Options.EnableAutoVerification = false;
  • #694 When calling RegisterConditional, the PredicateContext.Consumer property will now never return null, but instead it throws an exception. Use the new PredicateContext.HasConsumer property instead of checking for null. You will be affected when you checked PredicateContext.Consumer for null.
  • #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 from InstanceProducer<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.
  • #557 ConstructorInfo GetConstructor(Type) method of IConstructorResolutionBehavior interface replaced with ConstructorInfo? TryGetConstructor(Type, out string?) method. You will be affected when you replaced the default constructor resolution behavior.
  • #557 void Verify(InjectionConsumerInfo) method of IDependencyInjectionBehavior interface replaced with bool 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 new Options.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>, and AppendToCollection)
    • Container.RegisterCollection overloads (they have been replaced with Container.Collection.Register)
    • Container.RegisterSingleton overloads for registering already existing instances (they have been replaced with Container.RegisterInstance methods)
    • Scope's default constructor
  • #820: Lifestyle: protected Lifestyle.CreateRegistrationCore<T>(Container) method removed. You should now inherit from Lifestyle.CreateRegistrationCore(Type, Container). It has the same semantics.
  • #820: Registration: Type implemenationType and Func<object> instanceCreator = null parameters added to Registration constructor. You will be affected when you developed a custom lifestyle.
  • #820: Registration: BuildTransientDelegate<TService>(Func<TService>) removed. You can call BuildTransientDelegate() instead. You will be affected when you developed a custom lifestyle.
  • #820: Registration: BuildTransientExpression<TService>(Func<TService>) removed. You can call BuildTransientExpression() 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 of Registration 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 old Options.UseLoosenedLifestyleMismatchBehavior.
  • #393 InstanceProducer.ImplementationType property added.
  • #393 DependencyMetadata<TService> class added. You can now inject a DependencyMetadata<TService> or IEnumerable<DependencyMetadata<TService>> into a consumer to get metadata about the injected dependency.
  • #791 Container now implements IAsyncDisposable (only in .NET 4.6.1, .NET Standard 2.0, and .NET Standard 2.1 versions).
  • #791 Scope now implements IAsyncDisposable (only in .NET 4.6.1, .NET Standard 2.0, and .NET Standard 2.1 versions).
  • #557 static DependencyInjectionBehaviorExtensions class added with Verify extension method to mimic the old behavior of IDependencyInjectionBehavior.
  • #557 static ConstructorResolutionBehaviorExtensions class added with GetConstructor extension method to mimic the old behavior of IConstructorResolutionBehavior.
  • #810 Container.IsLocked property added.

API Difs

Complete list of bugs, features and improvements

-#229 Remove the reference-type restriction from Container.RegisterConditional and Lifestyle.CreateRegistration

  • #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 using Scope.AsyncDispose and Container.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.
  • #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) with Lifestyle.CreateRegistrationCore(Type, Container).
  • #818 Unresolved conditional root types lead to confusing exception message
  • #815 Resolving a stream collection always resolves the first instance
Assets 2

@dotnetjunkie dotnetjunkie released this Apr 25, 2020 · 7 commits to v4.10.x since this release

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

  • #811 Marked [Obsolete] attributes with error: true #811
Assets 2

@dotnetjunkie dotnetjunkie released this Apr 24, 2020 · 14 commits to v4.10.x since this release

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 a Lifestyle argument
Assets 2
Mar 25, 2020
Improved exception message.
Mar 25, 2020
Improved exception message.
You can’t perform that action at this time.