In Castle Windsor IoC, if you want to find the types that register a service, you can do it the following way:
List<Type> typeList = new List<Type>();
foreach (var item in moduleContainer.ResolveAll<IMyService>())
{
var theType = typeof(item);
Console.WriteLine("Found implementation: " + item.Name);
typeList.insert(theType);
}
However, this method actually creates an instance of the type.
How do I resolve implementation Type
(s) of a service interface without creating an instance?
moduleContainer.Release(item)
immediately after adding it to the list. Is there a better way? – Christian Stewart