The assembly I'm attempting to load using AppDomain.Load only references
System, System.Data, and System.XML, which are all FCL (v1.0.3705)
assemblies located in the GAC.

To narrow the problem down I used the C# Class Library wizard with the
default single .cs file, in which is a single [Serializable] class
with .ctor and a lone string property. Similarly, I created a Console
application, in which Main creates an object that does the work. This
worker object creates the new AppDomain, and then tries to call
AppDomain.Load. Here's the gist of it:

  // AppDomain.CurrentDomain.BaseDirectory is
  //   "C:\AssemblyLoad\LoadApp\bin\Debug\"
  AppDomainSetup setup = new AppDomainSetup();
  setup.ApplicationBase = @"C:\AssemblyLoadHelper\Helper\bin\Debug\";
  AppDomain helperDomain = AppDomain.CreateDomain("HelperDomain",
AppDomain.CurrentDomain.Evidence, setup);

  // "File or ... was not found."
  helperAssembly = helperDomain.Load( assemblyFullName );

It appears that the load machinery only supports loading assemblies from a
sub-directory of the current app. I didn't get this from the docs, nor from
Eric Gunnerson's article at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dncscol/html/csharp05162002.asp

thanks,

  -- still perplexed...

Reply via email to