List all objects in a Unity DI container

Is there a way to have a list of all the objects registered in my DI container. ResolveAll gives a list for a type, but I need a generic list for all types

+4
source share
1 answer

Well, you cannot get a list of all objects, because objects are not registered, there are types. Unity 2.0 added the UnityContainer.Registrations property, which you can use to see what is in the container.

If you have open generic files, a known error will be detected that causes the Registrations property to throw an exception.

+5
source

All Articles