Exemple #1
0
 /// <summary>
 /// Unload the web appdomain and delete the temporary application root
 /// directory.
 /// </summary>
 public static void CleanApp()
 {
     if (host != null)
     {
         lock (_appUnloadedSync) {
             EventHandler handler = new EventHandler(PulseAppUnloadedSync);
             WebTest.AppUnloaded += handler;
             WebTest t = new WebTest(PageInvoker.CreateOnLoad(new PageDelegate(UnloadAppDomain_OnLoad)));
             t.Run();
             Monitor.Wait(_appUnloadedSync);
             WebTest.AppUnloaded -= handler;
         }
     }
     if (baseDir != null)
     {
         Directory.Delete(baseDir, true);
         baseDir = null;
         binDir  = null;
     }
 }