title: Exception setting up handler for AppDomain.AssemblyResolve
body: <p>Create a new appdomain, setup the assemblyResolve handler and 
  you always get an exception saying 'assembly [current executing assembly] not found' </p>
  
  <p>what gives ? code is below</p>
  
  <pre><code>string _fileName = @"c:\temp\abc123.dll";
  
  AppDomain sandBox = AppDomain.CreateDomain("sandbox");
  
  sandBox.AssemblyResolve += new ResolveEventHandler(sandBox_AssemblyResolve); 
  // the line generates the exception !
  
  System.Reflection.Assembly asm = sandBox.Load(System.Reflection.AssemblyName
                                       .GetAssemblyName(fileName).FullName);
  
  foreach (System.Reflection.AssemblyName ar in asm.GetReferencedAssemblies())
      dbgWrite("Ref:  " + ar.FullName );
  
  
  System.Reflection.Assembly sandBox_AssemblyResolve
    (object sender, ResolveEventArgs e)
  {
  
      System.Reflection.Assembly asm = 
          System.Reflection.Assembly.LoadFrom(_fileName);
      return asm;
  
  }
  </code></pre>
  
  <p>exception is:</p>
  
  <p>System.IO.FileNotFoundException: Could not load file or assembly 'appAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'appAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' [snip]</p>