public static void InitializeServer(string physicalDirectory, int port) { if(currentIisInstance != null) currentIisInstance.Stop(); currentPort = port; currentIisInstance = new IisExpress(physicalDirectory, port); }
public When_creating_and_stopping_IIS_Express() { try { var iisExpress = new IisExpress("C:\\temp", 6845); startedJustFine = Process.GetProcessesByName("iisexpress").Length == 1; iisExpress.Stop(); stoppedJustFine = Process.GetProcessesByName("iisexpress").Length == 0; } catch { } }