You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
container.Register(typeof(Foo<>));// class Foo<T> { }container.RegisterSingleton(typeof(Bar<>));// class Bar<T> { }// Class Consumer<T>(Foo<T> f, Bar<T> b) { }container.Register<Consumer<int>>();container.Verify();
Verification fails complaining that Bar<int> is not registered.
Reason for this is that the RegisterSingleton overload called is RegisterSingleton(Type openGenericServiceType, params Assembly[] assemblies), which means that the following call is made:
Considering the following example:
Verification fails complaining that
Bar<int>
is not registered.Reason for this is that the
RegisterSingleton
overload called isRegisterSingleton(Type openGenericServiceType, params Assembly[] assemblies)
, which means that the following call is made:This results in the assembly scanning of non-generic implementations of
Bar<T>
within zero assemblies.This actually costed me 10 minutes to figure out what was going on. If this happens to me... it can happen to anyone.
The text was updated successfully, but these errors were encountered: