title: GetTypes from an Assembly that is an external dll
body: <p>I have 2 projects in my solution.  My first project is trying to search for all classes that are in a specific namespace and implement a specific interface.</p>
  
  <p>My website runs of the first project and imports the second as a compiled dll.  Now if I were to try and search for assemblies in a namespace that resides in my first project, then I have no issues, however the moment that I point to my second project, it can never find anything.  Here is my code:</p>
  
  <pre><code>const string @namespace = "MySecondProject.Models";
  var reports = from t in Assembly.GetExecutingAssembly().GetTypes()
                        where t.IsClass &amp;&amp; t.Namespace == @namespace &amp;&amp; typeof(IMyInterface).IsAssignableFrom(t)
                  select t;
  </code></pre>
  
  <p>I have also tried setting up the namespace variable to include second project name as i know this can be an issue when creating an instance of an object via reflection (encountered that before)</p>
  
  <pre><code>const string @namespace = "MySecondProject.Models,MySecondProject";
  </code></pre>
  
  <p>I am trying to understand why I am getting back no results and what is the correct way of doing this?</p>
  
  <p>I have also tried removing my interface check, but I still get same results.</p>
  
  <p>Edit:</p>
  
  <p>Here is the working code example for future visitors:</p>
  
  <pre><code>var assembly = Assembly.Load("MySecondProject");
  const string @namespace = "MySecondProject.Models";
  var reports = from t in assembly.GetTypes()
                        where t.IsClass &amp;&amp; t.Namespace == @namespace &amp;&amp; typeof(IMyInterface).IsAssignableFrom(t)
                      select t;
  </code></pre>