private static void unloading_modules_upon_request_callback() { SetUpInDomain(); _nomadKernel = new NomadKernel(_configuration); var expectedModuleInfos = new[] { //Set Up modules to be loaded. new ModuleInfo(_assemblyFullPath), new ModuleInfo(_assemblyFullPath2), }; SetUpModuleDiscovery(expectedModuleInfos); _nomadKernel.LoadModules(_moduleDiscoveryMock.Object); AppDomain moduleAppDomain = _nomadKernel.ModuleAppDomain; _nomadKernel.UnloadModules(); Assert.AreNotSame(moduleAppDomain, _nomadKernel.ModuleAppDomain); }
private static void Main(string[] args) { // signing the assembly and creating the manifest using manifestBuilder api GenerateManifestUsingApi(); // using default configuration var kernel = new NomadKernel(); // loading modules using directory module discovery pattern var discovery = new SimpleDirectoryModuleDiscovery(@".\Modules\"); // loading discovered modules kernel.LoadModules(discovery); //wait for input Console.ReadLine(); // unloading all modules kernel.UnloadModules(); //wait for input Console.ReadLine(); }