My simple implementation of a DI container
What you're actually doing is implementing Service Locator which is quite opposite to dependency injection. Please refer to [THIS] discussion about it.

Please use already existing solution.

Few points from my side, just to point out why I think that's wrong for your case:


Why do you think you need more lightweight DI container? Have you performed benchmarks and they proved that your bottle neck is DI injection?
Why have you choosen struct for DIReference? Struct is not good choice for a field, because you're unintenionally (I presume) allocating it on heap. Please refer to [THIS] discussion.
Why would you need DIReference anyway? It's only complicating your code. You don't need to store it as field anywhere - instances that you need are already kept in _references in DIContainer.
Just to point out, as your _references is static readonly field, then this Dictionary is singleton. It causes few potential problems, to name two:


Is it guaranteed that every time you install bindings there won't be any other threads that trying to do same thing?
Every instance in this dictionary is also singleton-ish. What I mean by that - as soon as first class will install PlayerController into your _references in DIContainer then it'll be available for all classes that uses your DIContainer class. Yet you can still overwrite it. Why would that be a problem? It could cause huge GC pressure, because you'll constantly overwriting PlayerController in your dictionary and GC will have to clean that up which could lead to stopping all threads from running. You definitely want to avoid that especially in games.



I want to strongly suggest to use already existing solution for DI. If you're worried about performance please refer to [THIS] benchamrks.