10

So MS dropped (free sourced) Unity. Future of Unity
The github repository appears inactive Unity on GitHub

Anybody know what is going on with Unity ?
Is there a IOC Dependency Injection tool for dotNet Core, if Unity is a dead end under dotnet core?

EDIT: Still waiting on news about Unity.
Alternatives for those searching: StructureMap , AutoFac
or our selection , SimpleInjector It very active on GitHub. There are many downloads daily already ~1Million from Nuget alone. And its fast, very well documented, a nice API with good extensibility. Microsoft.Extensions.DependencyInjection would have been the next choice. We dont have ASP.NET project, If you do then definitely look at MS DI. You can use MS DI in DotNet Core too,
I like SimpleInjector more. The docu is good, with over 500 downloads a day and more than 1 million in total, Simpleinjector has gone past critical mass.

EDIT2: Unity might just do a phoenix for .netcore. It is still kicking.
See Unity for .netStandard discussion on github. Although there isnt a great deal of activity yet. There is at least some support to get it working on Core. The question is will it be too little too late? Late migrators may still benefit. For now (2018) it still looks like alternatives are requried.
SimpleInjector is on making solid progress as a legitimate replacement.
See SimpleInjector Nuget page. Nearly 3 million downloads and >1k per day. As of June 2018.

6
  • 3
    nice tutorial about DI in net core: learn.microsoft.com/en-us/aspnet/core/fundamentals/… . you don't need unity anymore. Commented Mar 10, 2017 at 16:17
  • Thx Matthias. ASP.Net or for dotnet core Microsoft.Extensions.DependencyInjection is Ok, but not like StructureMap AutoFac or Unity. I have been using Unity in DotNet Frameworks for years. I went to use in dotnet core and found it wasnt available. Im still curious about Unity in dotnet core, but it looks like i need to choose between Autofac or StructureMap. The ASP.Net IOC is of consideration in ASP.net mvc projects. That doesnt apply to me. Commented Mar 12, 2017 at 21:00
  • Matthias you should change comment to answer. It is worth at least a tick. Best answer so far. Commented Mar 18, 2017 at 15:18
  • Have you tried just referencing the Unity DLL? According to the Portability Analyzer, the Microsoft.Practices.Unity DLL (at least the v2.0.414 version that I'm using) is 100% compatible with .NET Standard 2.0 Commented Nov 8, 2018 at 5:32
  • For anyone reading this question. there is support for .netcore github.com/unitycontainer/microsoft-dependency-injection Commented Nov 16, 2020 at 13:22

1 Answer 1

9

For net core you can find a nice tutorial about Dependency Injection:

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection or https://blogs.msdn.microsoft.com/webdev/2016/03/28/dependency-injection-in-asp-net-core/

Imho, implementing and using the Microsoft.Extensions.DependencyInjection is much easier, too. (At least for MVC-Web-Applications) you don't need unity anymore.

Sign up to request clarification or add additional context in comments.

4 Comments

Given microsoft provides automated registration processes for some tools even in non ASP situations andthe pervasiveness of tool make it a good suggestion and common ground for .net core solutions
there were a lot of lost features in unity. one example is interceptors, don't get with Microsoft.Extentions.DependencyInjection
@ChrisHayes so you are downvoting me for something that microsoft did not implement in their library? how about spending a few seconds with the search-function and you can find alternatives for interceptors, instead of voting my answer as "not useful". Other stackoverflow-users add another answer, writing "in addition to ...s answer, here is how to implement the missing function ...:" - just a hint, how stackoverflow works positive.
let's assume that I downvoted your answer. your answer does not answer the OP title. and THAT is how stackoverflow works. :(

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.