Inheritance: System.MarshalByRefObject
Exemplo n.º 1
0
        public void Test()
        {
            string applicationBase = "C:/Projects/oa-public/src/OrbisAccess.PublicSite.Specs/bin/debug";
            AppDomainSetup setup = new AppDomainSetup
            {
                ApplicationName = "Lee",
                 ApplicationBase = applicationBase,
                PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory,
                 PrivateBinPathProbe = AppDomain.CurrentDomain.BaseDirectory,
                 ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
             };
     
            Evidence evidence = new Evidence(AppDomain.CurrentDomain.Evidence);
            AppDomain domain = AppDomain.CreateDomain("Lee", evidence, setup);
             var loader =  domain.CreateInstanceFrom(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TechTalk.SpecFlow.GeneratorTests.dll"), "TechTalk.SpecFlow.GeneratorTests.Aqueduct.AssemblyLoaderNew");

            var loadner = new AssemblyLoaderNew();
            domain.AssemblyResolve += new AssemblyLoaderNew().Resolve;
            //C:\\Projects\\oa-public\src\\OrbisAccess.PublicSite.Specs\\bin\\debug\\
            var assembly = domain.Load("OrbisAccess.PublicSite.Specs");

            Assert.IsNotNull(assembly);
        }
Exemplo n.º 2
0
        public void Test()
        {
            string         applicationBase = "C:/Projects/oa-public/src/OrbisAccess.PublicSite.Specs/bin/debug";
            AppDomainSetup setup           = new AppDomainSetup
            {
                ApplicationName     = "Lee",
                ApplicationBase     = applicationBase,
                PrivateBinPath      = AppDomain.CurrentDomain.BaseDirectory,
                PrivateBinPathProbe = AppDomain.CurrentDomain.BaseDirectory,
                ConfigurationFile   = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
            };

            Evidence  evidence = new Evidence(AppDomain.CurrentDomain.Evidence);
            AppDomain domain   = AppDomain.CreateDomain("Lee", evidence, setup);
            var       loader   = domain.CreateInstanceFrom(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TechTalk.SpecFlow.GeneratorTests.dll"), "TechTalk.SpecFlow.GeneratorTests.Aqueduct.AssemblyLoaderNew");

            var loadner = new AssemblyLoaderNew();

            domain.AssemblyResolve += new AssemblyLoaderNew().Resolve;
            //C:\\Projects\\oa-public\src\\OrbisAccess.PublicSite.Specs\\bin\\debug\\
            var assembly = domain.Load("OrbisAccess.PublicSite.Specs");

            Assert.IsNotNull(assembly);
        }