From the comments:
The type that's found by resovledList[typeof(T)]
isn't the intended type. Instead, it's RuntimeType
. This would be a likely result of calling ResolveType<ISomething>(typeof(Something).GetType())
instead of ResolveType<ISomething>(typeof(Something))
:
typeof(Something)
is a value of type Type
(actually RuntimeType
, which derives from Type
), so calling typeof(Something).GetType()
gives you typeof(RuntimeType)
.
As it turned out, you were actually calling GetType()
somewhere else, but the problem and solution are the same: you shouldn't call GetType()
here.