title: Could not load type from assembly
body: <p>Before you say anything, I have read the previously asked questions about this issue. The answers there did not fix my problem.</p>
  
  <p>It's pretty simple, I guess, if you know the answer. Here's my problem:</p>
  
  <p>I've got a solution with several projects, I'm creating a plugin-based application where I use Reflection to load all assemblies. This part goes fine, I load all my assemblies like so</p>
  
  <pre><code>        var filePaths = Directory.GetFiles(@"C:\CustomerServiceModule\", "*.dll", SearchOption.AllDirectories).Where(n =&gt; n.Contains("bin"));
          foreach (var f in filePaths)
          {
              Assembly.LoadFile(f);
          }
  </code></pre>
  
  <p>Now I want to create an instance of a type, so I can work with it:</p>
  
  <pre><code>            var assembly = AppDomain.CurrentDomain.GetAssemblies().Where(a =&gt; a.ManifestModule.Name == "Kayako.dll").SingleOrDefault();
              var name = assembly.GetTypes();
              var type = assembly.GetType("Kayako.KayakoData");
              var lol = Activator.CreateInstance(type);
  </code></pre>
  
  <p>This goes badly because inside KayakoData I have this:</p>
  
  <pre><code>KayakoService _service = new KayakoService("xxx", "yyy", "zzz");
  </code></pre>
  
  <p>This service is an assembly that works, I've used it before. Version number is fine, there's nothing in the GAC that overrides it, I can't see any errors using Assembly Binding Log Viewer. I still get this error: </p>
  
  <blockquote>
    <p>[System.LoadTypeException]{"Could not load type 'KayakoRestAPI.KayakoService' from assembly 'KayakoRestAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.":"KayakoRestAPI.KayakoService"}</p>
  </blockquote>
  
  <p>Anyone have any bright ideas? I've been staring myself blind at this. If I remove the service part from KayakoData the whole thing works, but I really need to run the service.</p>