Example #1
0
 /// <summary>
 /// Kill the web server process
 /// </summary>
 /// <param name="inst"></param>
 public static void StopServer(this ITestServer inst)
 {
     TestServerIPC.Dispose();
     try
     {
         if (inst.ServerProcess != null)
         {
             inst.ServerProcess.Kill(); // parent process only in .NET Framework, unlike Core
             inst.ServerProcess.WaitForExit();
         }
     }
     catch { }
     finally
     {
         inst.ServerProcess.Dispose();
         inst.ServerProcess = null;
     }
 }
Example #2
0
 /// <summary>
 /// Kill the web server process
 /// </summary>
 /// <param name="inst"></param>
 public static void StopServer(this ITestServer inst)
 {
     TestServerIPC.Dispose();
     try
     {
         if (inst.ServerProcess != null)
         {
             inst.ServerProcess.Kill(true); // recursive in .NET Core, unlike Framework
             inst.ServerProcess.WaitForExit();
         }
     }
     catch { }
     finally
     {
         inst.ServerProcess.Dispose();
         inst.ServerProcess = null;
     }
 }