title: How to prevent ReflectionTypeLoadException when calling Assembly.GetTypes()
body: <p>I'm trying to scan an assembly for types implementing a specific interface using code similar to this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public List&lt;Type&gt; FindTypesImplementing&lt;T&gt;(string assemblyPath)
  {
      var matchingTypes = new List&lt;Type&gt;();
      var asm = Assembly.LoadFrom(assemblyPath);
      foreach (var t in asm.GetTypes())
      {
          if (typeof(T).IsAssignableFrom(t))
              matchingTypes.Add(t);
      }
      return matchingTypes;
  }
  </code></pre>
  
  <p>My problem is, that I get a <code>ReflectionTypeLoadException</code> when calling <code>asm.GetTypes()</code> in some cases, e.g. if the assembly contains types referencing an assembly which is currently not available.</p>
  
  <p>In my case, I'm not interested in the types which cause the problem. The types I'm searching for do not need the non-available assemblies.</p>
  
  <p>The question is: is it possible to somehow skip/ignore the types which cause the exception but still process the other types contained in the assembly?</p>