C# – Load all types that implement an interface in the current assembly

To get all types in the current assembly that implement a specified interface, use the following: To create instances of these types, loop through them and use Activator.CreateInstance(), like so: Example – Auto-wire a command routing table Let’s say we want to build a command routing table. We have commands and want to automatically wire … Read more C# – Load all types that implement an interface in the current assembly