The Unity container will automatically resolve any type that it can figure out on its own without the need for manual registration. That\'s good in some ways, but the proble
I tried the DefaultLifetimeManegerExtension but somehow it didnt work. (Maybe Unity has changed?). Anyways if you dont want to use an Extension you can also make use of the RegsiterByConvention feature.
container.RegisterTypes(AllClasses.FromLoadedAssemblies(), WithMappings.None, WithName.Default, x => new DisposingTransientLifetimeManager());
This will register all Classes with the "DisposingTransientLifetimeManager" which I chose to use as a default one. Note that you should do this at the beginning of your registrations since all registrations will overwrite any previous registrations of the same Type and Name.