public void Create() { var domain = new DomainLoader("API", false); domain.Load(); domain.Unload(); Assert.IsTrue(true); }
public void CreateWithShadowCopy() { var domain = new DomainLoader("API", true); domain.Load(); Assert.IsTrue(System.IO.Directory.Exists(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "API\\cache")), "API\\cache failed to create"); domain.Unload(); Assert.IsTrue(true); }
public void CheckDomainName() { var domain = new DomainLoader("TestDomain", "API", true); domain.Load(); domain.DoCallback(() => { //this method executes in the other domain Assert.IsTrue(AppDomain.CurrentDomain.FriendlyName == "TestDomain"); }); domain.Unload(); Assert.IsTrue(true); }
public void CallDoCallback() { var domain = new DomainLoader("API", true); domain.Load(); domain.DoCallback(() => { //this method executes in the other domain var al = AppDomain.CurrentDomain.GetData("AssemblyLoader"); Assert.IsTrue(al != null); }); domain.Unload(); Assert.IsTrue(true); }
public static void Initialize() { AppDomain.CurrentDomain.SetupInformation.ShadowCopyFiles = "true"; AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories = WebSettings.PluginBinPath; MoveFiles(new DirectoryInfo(WebSettings.PluginPath), new DirectoryInfo(WebSettings.PluginBinPath)); DomainLoader loader = new DomainLoader("app", "loader", WebSettings.PluginBinPath.Substring(WebSettings.PluginBinPath.LastIndexOf(Path.DirectorySeparatorChar) + 1)); loader.Load(); loader.Unload(); RegisterPlugins(); //ObjectResolver.Init(); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new SpiderViewEngine()); ControllerBuilder.Current.SetControllerFactory(new SpiderControllerFactory()); PluginWatcher watcher = new PluginWatcher(); watcher.Watch(); }