title: Dynamically loading assemblies in asp.net
body: <p>I'm currently trying to dynamically load an assembly from within a asp.net httphandler. I have a dll that is built as part of a seperate library and my project contains a reference to said DLL and is deployed along with the service with CopyLocal true. I create a throwaway object to get the assembly path and I have confirmed the existence of the dll within the Temporary ASP.NET Files folder, but calling GetTypes() throws an exception.</p>
  
  <p>I do something like:</p>
  
  <pre><code>string assemblyPath = new SomeClassInAssembly().GetType().Assembly.Location;
  Type[] types = System.Reflection.Assembly.LoadFrom(assemblyPath).GetTypes();
  </code></pre>
  
  <p>I cannot add the assembly to the GAC since that would defeat what I am trying to do with the service (think sandbox service that loads assemblies when necessary) and I cannot find anything that has been able to fix my problem thus far.</p>
  
  <p>For reference I'm using VS 2008.</p>