[Mono-list] AppDomain and AppDomainSetup

kojoadams kojoadams@hotmail.com
Tue, 14 Jan 2003 05:44:26 -0500


N.B. This works on .net
----- Original Message -----
From: "kojoadams" <kojoadams@hotmail.com>
To: <mono-list@ximian.com>
Sent: Tuesday, January 14, 2003 5:37 AM
Subject: [Mono-list] AppDomain and AppDomainSetup


Hi all,

    I just made a test app with this layout

    \
      Driver.exe
      domain2
              \
               web.config
               Domain2.exe
               lib
                   \
                    Class.dll

    with Domain2.exe references Class.dll.

    the code for Driver.cs is something like:

    using System;
    public class Driver{
        public static void Main(){
            AppDomainSetup setup = new AppDomainSetup();
            setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory +
"domain";
            setup.ConfigurationFile = "web.config";
            setup.PrivateBinPath = "lib";

            AppDomain domain = AppDomain.CreateDomain("a domin", null,
setup);
            domain.ExecuteAssembly("domain2/Domain2.exe");

       }
   }


   It fails because mono_assembly_load does not look in the lib subdirectory
for Class.dll. Also, it does not change the change the ConfigurationFile to
point to web.config.

kojo