Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Future of the project

Before making any changes to Unity Container organization I've decided to solicit feedback from the community. The issue at hand is the survival of Unity Container library and further development beyond version 5.11.x

During all these years, since Unity was released in 2008, a lot of companies invested heavily into integration with the library. Every major bank I ever worked for, for example, has a project or two based on the container. But now it is all in jeopardy and the killer is what used to be a very desirable thing - the rate of innovation of .NET platform.

When a new version of .NET was released every 10 years or so and every new framework was a direct descendant of the previous one it wasn't that hard to maintain the library. Changing a few lines here and there would keep it working, but with the release of .NET 5.0 it all changed. It is no longer backward compatible and the current model of support and development does not allow enough time and resources for producing proper quality code.

Besides abandoning outdated APIs, version 5 of .NET introduced some new and exciting features:

  • reach metadata
  • static code generation
  • integration with Visual Studio

But neither .NET 5.0, nor these new features are fully compatible with the current Unity Container engine. A new engine is required.

Unity Container project requires dedicated, full-time personnel to do proper development and documentation. It can no longer be supported at leisure time by enthusiasts. To survive the project requires the support of the community.

Unity is a .NET Foundation project. I thought continuity is important, so I've applied and project has been accepted.
But .NET Foundation does not sponsor or support the project. It does not provide any financial help whatsoever.

There are several directions the organization might take to solicit support and raise funds to continue its existence:

  • Do the humane thing and let it die peacefully
  • Change license and require to pay for new versions
  • Have a tiered structure with free and paid content
  • Raise money via donations
  • etc.

I would like to hear opinions and suggestions regarding this issue in hope that together we can figure the best solution for the problem.

You must be logged in to vote

Replies: 27 comments · 43 replies

Comment options

After years of using this package and falling in love with it, I would say I am sad. First of all very big thanks for all the hard work. In my opinion the .Net Core now .Net 5.0 is a different beast in regards to DI factory. With a sad heart I vote for: "Do the humane thing and let it die peacefully"

You must be logged in to vote
1 reply
@LymWm
Comment options

UnityContainer was the first IOC container I learned to use, and I had different feelings for it. If there is a follow-up release, I'm willing to pay for it

Comment options

I voted to change to a new version to pay

You must be logged in to vote
0 replies
Comment options

I used many containers and unity is by far the one I most liked. I feel very said to see the path it is taking, I would like to see it being used as the default container in MVC core and bing constantly improved, I would like to help and would be glad to invest two hours a month on it. If paying is the only way to keep it active and evolving I would probably pay for it. Considering the amount of comments here it seems that there is few people interested in it at the time. I miss Patterns & Practices team and enterprise library too...

You must be logged in to vote
1 reply
@ENikS
Comment options

ENikS Oct 27, 2021
Maintainer Author

I've tried to maintain Unity part time, but it introduced more issues than I fixed. It is a full time job.

I would love to continue work on the project, but unfortunately I can no longer afford sponsoring it on my own.

Comment options

fwiw we use Unity 5.11 on .net 5 linux/docker and it works well for us (the application has been on Unity since 2011). I do not see us needing new features just maintenance/bug fixes and compatibility with the latest .net which we have so far with 5.11. I'd sadly vote for let it die and accept prs/bug fixes where/if possible....I just can't see enough people paying for it to be worth the hassle

You must be logged in to vote
0 replies
Comment options

ENikS
Nov 9, 2021
Maintainer Author

To say, "I am disappointed at the complete lack of interest from the community" would be a colossal understatement, but not much could be done here. So, as of now, I am officially stopping support and development.

The entire Unity library is archived, and no more releases, support, or maintenance will be offered.

You must be logged in to vote
1 reply
@luizfbicalho
Comment options

For me unity was the best container, the config in file help clean the code, I honestly tried to help but I coudn't solve the issues that I opened, and when I upgraded to .net core, all of my implementations stopped working, it's a shame that it's ending

Comment options

I have to say that I just saw this and I am too sad.
We're using this in a large scale operation and created a lot of nice things around it, its the heart of our system.

Sad to see it go, we'll need to start thinking hard how to advance here.

As a deprecated library, what is the license now? does it change?

FYI, .net6 is NOT supported as they deprecated "strongly typed keys".

You must be logged in to vote
10 replies
@rizi
Comment options

Just checked as well, i presume the only change is to remove: { KeyPair = new StrongNameKeyPair(pair)

But it should be done with ifdef on .netcore probably (it might have meaning on .netframework)

@rizi Are you preparing a PR?

At the moment I'm on holidays and I have no access to an computer, maybe after my holidays. Is it still possible to create a PR? And would it be merged by @ENikS .

Br

@yfital
Comment options

I can confirm that moving it to
#if NET40 || NET45 || NET46 || NET47 || NET48 || NETFRAMEWORK allows us to continue working

@mechelewskim
Comment options

Am I right that the project can be affected by this issue only when it's using Unity.Interception nuget and adding the extension like below?
container.AddNewExtension<Interception>();
@yfital @rizi

@rizi
Comment options

Am I right that the project can be affected by this issue only when it's using Unity.Interception nuget and adding the extension like below? container.AddNewExtension<Interception>(); @yfital @rizi

That's correct.
Br

@maciejsobocinski
Comment options

fwiw we've been on .net 5 then .net 6 for months now using Unity with zero issues just not using that extension. We have no plans to migrate off of it anytime soon.

Comment options

Hello friends of Unity.
I am sad to hear that Unity will not be developed any further. I have worked in several machine industry companies using Unity with Prism. I know that desktop applications are going out of fashion. My experience is that in many machine industries desktop applications are still common. Such companies are technologically not at the front. Many still work with .net Framework 4.5 4.7 or 4.8. At the same time in such companies the OpenSource is still often an unfamiliar way to work. There is often a fear of knowledge theft. Often employees are also prevented by contracts to work on OpenSource projects. Despite this, Unity is widely used in these companies. The loss will most likely be recognized years from now.
I have worked with several IoC containers and Unity is the most suitable for the kind I prefer. How can we support the project to revive it?

You must be logged in to vote
1 reply
@rizi
Comment options

@ENikS what would you need to keep the project running (and up to date)?

br

Comment options

I'm OK paying a fee to keep the project going. I think there are developers and/or companies out there who would be willing to offer financial support, you just need to somehow get the word out there so that people hear and listen.

You must be logged in to vote
1 reply
@MartinEgli
Comment options

Should we start crowdfunding? How much does it brew per year?

Comment options

Unity is legacy software. There is no conceivable reason for it to exist, never mind continue to receive updates, when dependency injection is built into .NET now.

If your application depends on Unity, then either spend the time and effort to upgrade it to use .NET's built-in DI (which you honestly should have done literally years ago), or accept that your software is stuck on .NET < 5 and is thus also legacy.

You must be logged in to vote
5 replies
@rizi
Comment options

@IanKemp we have the latest unity version running with .Net 6.
Does the .Net build-in DI have all features that Unity or Autofac have?

br

@luizfbicalho
Comment options

.NET DI doesn't have file configuration and named registrations

@rizi
Comment options

.NET DI doesn't have file configuration and named registrations

thx, at least for our company that's a no go --> so we have to support Unity in some way or move on to some other DI-container (like Autofac).

@MartinEgli
Comment options

In detail, not all DI have the same behavior. The One DI will probably never exist.

@rjgotten
Comment options

.NET DI doesn't have file configuration and named registrations

Also doesn't have a concept of child containers which can take additional registrations.
It only has one top level container and three lifetimes:

  • singleton, meaning one instance in the entire container;
  • scoped, meaning a new instance per IServiceScope; and
  • transient, meaning a new instance per resolve,

and that's it. There's no way to model something like a multi-ton as would be typical for e.g. a multi-tenant solution.

As there are no explicit child containers there's also no way to override a type registration to resolve to different types at different hierarchy levels, or to use different implementations within sibling containers at the same hierarchy level (which would again be something that caters to scenarios like multi-tenant applications).

These are all things Microsoft explicitly doesn't want to support -- People have asked before, and got told exactly that. -- so don't expect them to ever be added either. The advice MS will give you is that for more advanced usage scenarios you will have to integrate a third party container.

Comment options

I am shocked and dismayed to discover that Unity has been archived. I use Unity in almost all my work, and just about every single hobby project with more than a few classes.
I am not however the most supportive person, I'll admit that. I just use it.
And as long as things work, I don't worry much about it.

The DI that has been baked into .NET is adequate, but by no means as feature complete as Unity is.
I don't know what is needed to keep the container going, and I don't have the time or energy to pitch in.

But I am certainly sad to see it go.

Or rather, of course it won't go away any time soon, but it is inevitable when all future development has been stopped.

You must be logged in to vote
0 replies
Comment options

ENikS
Dec 5, 2021
Maintainer Author

By looking at my LinkedIn profile, you may see that I am just a regular developer deriving my income from my work. I was hoping, in time, to derive all my income from work on Unity.

Unity is an extremely-useful, full-featured, “classical” platform. Unfortunately, there is no fame or glory in working on it, just thousands and thousands of hours of mundane work. The only compelling reason to spend any effort on Unity is to earn money from companies that depend on the library in their core business and are willing to pay for work.

If there is no paycheck associated with these efforts, I see no conceivable reason why any reasonable person would work on Unity with no benefit for themselves.
At the end of the day, it is all about paying bills and providing support for the family.

You must be logged in to vote
5 replies
@rizi
Comment options

By looking at my LinkedIn profile, you may see that I am just a regular developer deriving my income from my work. I was hoping, in time, to derive all my income from work on Unity.

Unity is an extremely-useful, full-featured, “classical” platform. Unfortunately, there is no fame or glory in working on it, just thousands and thousands of hours of mundane work. The only compelling reason to spend any effort on Unity is to earn money from companies that depend on the library in their core business and are willing to pay for work.

If there is no paycheck associated with these efforts, I see no conceivable reason why any reasonable person would work on Unity with no benefit for themselves. At the end of the day, it is all about paying bills and providing support for the family.

I totally agree, I will talk to our CEO.

Would it also be considerable for you to let someone else maintain this project?

Br

@luizfbicalho
Comment options

I'm not sure if it's that easy, unity is not that simple to understand

@rizi
Comment options

I'm sure that won't be easy, but it would be sad to let this project go.

@luizfbicalho
Comment options

i think that too, I used unity for many years, created extensions, I really like it

@damianh
Comment options

Would it also be considerable for you to let someone else maintain this project?

Be careful with this. It opens up big can of worms on supply chain management side of things. If someone wants to maintain it, they should launch a fork and it either sinks or swims accordingly.

Comment options

To be perfectly honest, I do not believe there is a market for paid DI containers. There are just too many free options available.
I love Unity for the ease of use, but if I really had to, I suppose I would be able to switch to another container fairly easy.

I fully understand that this is not a one-man project.
If Unity is to survive, I think it would be necessary to have a core team of maybe 2 - 4 members that maintains it.
Some kind of donation program would probably help.
And the community would still be able to pitch in with pull requests etc.

But of course, the interest needs to be there.
If no-one is able or willing to take over, or join in, well, then the container is dead.

You must be logged in to vote
0 replies
Comment options

ENikS
Dec 7, 2021
Maintainer Author

I want to rephrase my previous post:

Companies that depend on the library in their core business and other Interested parties could come tegether and hire a developer to maintain the project. I would like to be that developer. If more developers are required, the budget could be increased.

And of course, everyone are welcome to contribute.

You must be logged in to vote
2 replies
@damianh
Comment options

@ENikS I think you've made the right decsion. When we pulled NancyFX, we left the door open for busineses to get support such as sponsoring a .NET Core/5/6 version for migration/continuity reasons, or consultancy to migrate to AspNetCore. We had a few enquiries but absolutely zero engagements (most didn't even respond after we responded to their intial enquiry). I also pulled ProxyKit the minute Yarp was announced. "Interested parties" won't come together - that is just not the culture in .NET (oss) ecosystem.

Take pride in the work you've done and happiness from the journey and friends you've made along the way. You don't owe anyone anything.

@anakic
Comment options

Take pride in the work you've done and happiness from the journey and friends you've made along the way. You don't owe anyone anything.

I haven't played around with the built in container in .NET 6 so I don't have a strong opinion on this decision, but I did wanted to chime in and say I used and liked Unity for many years. As someone who spent an inordinate amount of time and money on one of my own projects without getting much back (financially), I understand the decision and completely agree with @damianh's sentiment above.

Comment options

How about an different approach?
What if we port the features that are very useful in unity to another container that already has more common features with unity.
This way we could make a unity shell over the second best container.

This way we could get configuration files again, registration conventions, named registrations and so on

You must be logged in to vote
1 reply
@rizi
Comment options

How about an different approach? What if we port the features that are very useful in unity to another container that already has more common features with unity. This way we could make a unity shell over the second best container.

This way we could get configuration files again, registration conventions, named registrations and so on

We moved to Lamar( https://github.com/JasperFx/lamar), it has an very active community and maintainer and has more or less all features that unity has.

Comment options

Unity Container have alternatives? any competence? Who can reject to continue (with dontations/license ofc) a project with 46Millions of downloads.?

I think that you have 2 alternatives:
1.- To stay and get benefits
2.- Share to community with free code.

Other options only offers (actual) a bad image of you.

You must be logged in to vote
4 replies
@rjgotten
Comment options

Unity Container have alternatives?

Autofac come to mind. As does StructureMap.

There's also Lamar, which is a work-in-progress refactoring of StructureMap - specifically tuned to support the ASP.NET Core DI abstractions.

@xcap2000
Comment options

I am using Autofac and no issues so far.

@rjgotten
Comment options

Same here. Autofac was (almost) a drop in replacement after wiring it into the ASP.NET Core DI abstractions.
Just a few minor gotchas where it behaves different from Unity.
The two with the most impact being:

  1. No automatic resolves of non-registered concrete classes without adding a specialized registration source for it in Autofac; and
  2. No transitive resolves of type registrations, i.e.
    services
      .AddSingleton<ISomeInterface, ISomeOtherInterface>()
      .AddSingleton<ISomeOtherInterface, ActualConcreteType>()
    will work and resolve ActualConcreteType for both interfaces with Unity - but won't work with Autofac when attempting to resolve ISomeInterface.
@inyourpc
Comment options

Even though I knew nothing about library or project, and why its being killed, but at this sad occasion I will only say "RIP, Sadge and die in honor".

Comment options

I voted to change to a new version to pay!

You must be logged in to vote
0 replies
Comment options

come back from 2 years of absence and want to use .net 6 , wpf , prism and used unity as DI and now nothing fits together again. I switched from MEF to
Unity and know again it Is deprecated, prism can’t use .Net 6 DI. I have no clue how to go on from this point here. Has someone a hint how to combine wpf , prism , net 6 and which DI best choice currently ?

You must be logged in to vote
2 replies
@IsmailHassani
Comment options

@Mer0winger :
Frankly, i don't know if you should use Unity. I ditched all previous frameworks a long time ago.
The problem with them, they will always do things differently. Thats why i ended up with an own framework. ;)
I would suggest to stick with the Microsoft DI and use an own MVVM implementation. Take a look at MvvmLight or even better MVVM Toolkit. It's a long time ago i used Prism.
Due to incompatibilities with UWP i left this (superb) library long ago.

@xcap2000
Comment options

I used Autofac to replace unity, had to do some small changes and learn how to register things in autofac, in my case it was successful but the application is a small one. I used Prism and AvaloniaUI.

Comment options

Unity has everything I need, it runs without ANY problems in many projects. I would love to continue using it and am willing to contribute financially.

You must be logged in to vote
0 replies
Comment options

I have no idea which version is compatible which any specific unity version. I primarily use 2019.3.13f.... which is a bit old. What the hell version of this should I even be using?

You must be logged in to vote
0 replies
Comment options

@Mer0winger Take a look at this framework https://github.com/LogoFX/mvvm
It has everything you need for WPF+MVVM development

You must be logged in to vote
1 reply
@SwissMaWi
Comment options

This is about dependency injection.

Comment options

I am honestly surprised to see so few comments here since Unity is so widely used. I am currently in the process of migrating a project off of NancyFX/Unity to built in .NET Core equivalents, I was surprised to see named registrations not supported. That led me here to see if Unity could be kept and if it had support through .NET 6 and beyond, sadly it seems that it will not. It would seem to me that 3rd party DI engines may all run into a similar issue one day and using a MS solution would provide the most longevity at the expense of needing to refactor items such as named registrations in order to convert.

Thank you to the contributors that kept Unity going so long.

You must be logged in to vote
1 reply
@Rubiss
Comment options

By the way, here is an article with a workaround for named registrations with the .NET Core Container: https://stevetalkscode.co.uk/named-dependencies-part-1

Comment options

"Unity Container project requires dedicated, full-time personnel to do proper development and documentation" that is something I always wondered about Open Source software. I would love to contribute, yet I need a paying 100% job to survive. How can anyone but a millionnaire work full time without payment?

You must be logged in to vote
0 replies
Comment options

I use Unity, but have not visited these pages for awhile, so I may have missed the opportunity to weigh in. I would like to see unity at least handle any security issues if they came up and put out one release every year even if the release just increments the copyright date. Why? If you are familiar with DAMS Government Software Registry, if it has been more than one year since a version was published, they consider it abandoned-ware and won't allow it to be used. We recently had a scare in that ASP.NET MVC had not released a new version in several years and it was being discussed that no government contractor could use it anymore. Can you even imagine! If we could just handle any CVE's that are posted and do one release every year I would be so grateful.

You must be logged in to vote
0 replies
Comment options

On nuget.org I can see only the latest versions of all the packages are marked as deprecated. Is this on purpose?
We are regularly scanning dependencies for obsolete packages, but earlier versions of unity do not show up.

You must be logged in to vote
0 replies
Comment options

Very suprised by the state of the project; this is too bad.

Simple questions:

  1. how much do you need yearly to keep the project alive ? (minimum, ideal)
  2. why can't MSFT do yearly donations ? the project came from there didn't it ? Also it's a .net foundation project: why can't this foundation do something about it ?
  3. I did not see "enough" the need of community donations: wasn't there something sub-optimal there ? (eg., I can see firefox plugins or wikipedia asking for donation 1-2 per year; why not nuget packages ?)
You must be logged in to vote
0 replies
Comment options

@ENikS
Hi Eugene,
my company uses Unity in their product. Our security colleagues found out about EOL of Unity and want us to take action.
When they saw that Unity is no longer maintained, there was a statement here on github that it is no longer maintained (last year). This statement is no longer visible here, but only on Nuget when you want to get the package.
Today we had a look into github and now we are confused. We saw that you are working on three branches currently. Does that mean that the project is still maintained?
The main point I need to know: If there is a security issue/weak point in the code, will it be fixed by someone (most likely you)?

Thank you for all your work you already did.

Best regards,
Daniela

You must be logged in to vote
0 replies
Comment options

ENikS
Mar 29, 2023
Maintainer Author

@DaChFu

I have some free time and using it to work on Unity.
I don't think there would be any problem fixing an issue or two in case something serious comes up.

You must be logged in to vote
7 replies
@PeterOscarsson
Comment options

@dansiegel, @ENikS
First, thanx for your work. I use both Unity (all projects) and Prism (WPF) a lot.
Please do continue to maintain both Unity and Unity support in Prism.
I think there is a LOT of code out there that is using that combo.

I do not have the skill to help you out, by coding, but will do what I can and and sponsor you both (and @brianlagunas), to show that I realy appriciate the work you all do with Unity and Prism.

@ENikS
Comment options

ENikS Aug 8, 2023
Maintainer Author

@PeterOscarsson

Thank you Peter!

@dansiegel
Comment options

@ENikS just wanted to check in with you. I know it seemed that you were planning on doing an update for a v6. Is this something that you still plan on doing?

@tomasjuricek
Comment options

RIP @ENikS

https://www.gofundme.com/f/eugene-sadovoi

@dadhi
Comment options

OhMyGod, such a sad news

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change ❕ This change breaks public API
Morty Proxy This is a proxified and sanitized view of the page, visit original site.