Rezolver

.Net IOC container built from the ground up to support the .Net Standard 1.1 profile (and therefore supporting Asp.Net Core and Xamarin environments). It's fast, very extensible, and has a lot of cool features. Try it now!

Rezolver is now archived - no more updates will be pushed to the repository.

The library is still fully functional, but will not be updated to future versions of .Net, sorry!

Thanks for all the support 😃

Rezolver Logo

Rezolver

Rezolver is a high performance open-source IOC container for .Net Core.

You can get the Rezolver Package from Nuget, and for more
packages, head over to the packages documentation.

For more information, including API reference and developer how-tos, head on over to the
Rezolver website.

Follow us on twitter for code or documentation updates/release notifications etc.

Build Status


Version Highlights

2.0.0

  • TFMs changed for main package (#78):
    • NetStandard2.0, netcoreapp2.2, net472 and net48
    • The targeting of specific runtimes is to allow some more advanced caching technology, based on System.Reflection.Emit, to work. In theory, once netstandard2.1 is here,
      these will be able to be removed in favour of simply targeting the 2.0 and 2.1 flavours of .Net Standard.
  • Major performance improvements:
    • Enumerables +2500%
    • Constructor injection up +368%
    • Compilation speed has also been improved.
  • Scopes are now always present (#89)
    • But, by default, the Container class won’t support instance tracking or explicitly scoped registrations. You need to create a scope to do this, unless…
    • You use ScopedContainer instead, which creates its own ‘root’ disposable scope on creation. This will be used by default by Asp.Net Core)
  • Got rid of a whole bunch of interfaces in favour of concrete classes with non-virtual (where possible) methods (#90):
    • IResolveContext -> ResolveContext
    • IContainer -> Container
    • IContainerScope -> ContainerScope
    • ICompiledTarget -> retired for factory delegates, Rezolver.IInstanceProvider and Rezolver.IInstanceProvider<T>
  • Got rid of a bunch of Resolve extension methods in favour of concrete methods on the types
  • New Container/Scope/Context behaviour:
    • IServiceProvider is now explicitly implemented by all three of Container, ContainerScope and ResolveContext
    • All three also have their own Resolve method implementations, the behaviour of which is slightly different for each:
      • All Container instances have a Scope
        • The default root scope used by Container doesn’t track instances, only child scopes
        • ScopedContainer should be used if you want the root scope to track instances (this is the default for Asp.Net Core and Generic Host integration)
        • Resolving through a Container uses the scope on the ResolveContext, but defaults to its own Scope when calling the Resolve methods which only take a type
      • All ContainerScope instances have a Container
        • Resolving through a Scope routes the call to its own Container, but with a ResolveContext which fixes the Scope to that scope.
      • ResolveContext now only has a Scope (the Container property just proxies the Container from the scope)
      • Resolving through a ResolveContext routes the call to its own Scope (and therefore Container)
  • OverridingContainer renamed to ChildContainer (#87)
    • Constructor now no longer accepts an IRootTargetContainer on creation. To register new services, you create a new instance and then register into it via its implementation of IRootTargetContainer
  • OverridingTargetContainer renamed to ChildTargetContainer (#88)

1.4.0

1.3.4

Primary purpose of this release was to have a build that’s been built and tested explicitly against the .Net Core 2.1
runtime and Asp.Net Core 2.1.

  • Added SourceLink Support
  • Core library now targets .NetStandard1.1, .NetStandard2.0 and net45 (Removed net461 as it was pointless)

Asp.Net Core 2.1 Integration

  • Rezolver.Microsoft.AspNetCore.Hosting updated dependency to Asp.Net Core 2.1
  • Rezolver.Microsoft.Extensions.DependencyInjection updated dependency to Asp.Net Core 2.1

1.3.3

As always, for the full list of changes, check out the version history.

Bugfixes for generics handling, specifically:

  • Singletons matched contravariantly or covariantly did not honour the pattern
  • Registering Foo<T, U> : IFoo<IBar<T, U>> against <IFoo<IBar<,>> caused an IndexOutOfRangeException

1.3.2

  • Generic covariance
  • Mixed variance
  • Enumerable Projections
  • List member bindings (collection initialisation)
  • Selection of constructors on open generics
  • Fluent API to build per-member bindings

1.3 & 1.3.1

  • Support for Asp.Net Core 2.0
  • Contravariance
  • Decorator Delegates
  • List, Collection and Array injection
  • … Plus loads of bug fixes and other enhancements 😃

All these features are documented on our website.


Performance

Rezolver has now been incorporated into @DanielPalme’s excellent IOCPerformance benchmark.

Read our own notes on Rezolver’s performance in this benchmark, which provide some context on the areas where it can be improved.

Hint: Unless you’re creating child containers with additional registrations, Rezolver’s performance is right up there with the fastest.

Contributing

Feel free to fork this repo, build from the source, and submit pull requests for new functionality or bugfixes!