Getting a list of classes that inherit a specific interface? : <p>I'm using dependency injection in my project and wondered if it would be easier to just register all 30+ of my classes that inherit a certain interface using a for each, that way it works dynamically.</p>

<p>I've looked it up on Google, SO, RJ, YHA, and more Q&amp;A sites but nothing helps. It just explains if you already have a collection of them classes, and none show you how to do it from just an interface.</p>

<p>For example, I need to get a list of Class1, 2 and 3, and any other clases that inherit IClass.</p>

<pre><code>class Class1 : IClass {}
class Class2 : IClass {}
class Class3 : IClass {}
</code></pre>

<p>If I were to later on declare these, they would also be found.</p>

<pre><code>class Class4 : IClass {}
class Class5 : IClass {}
class Class6 : IClass {}
</code></pre>
