public void Dispose() { if (iisProcess != null) { iisProcess.Dispose(); iisProcess = null; } }
private void StartSite() { try { var procId = IISProcessManager.ExecuteProcess( App.IISExpressConfig.IISExpressAddress, "/site:\"" + SiteName + "\""); ProcessId = procId.ToString(); } catch (Exception) { Status = SiteStatus.Error; throw new InvalidOperationException("Could not start the process!"); } Status = SiteStatus.Running; }
private void StopSite() { try { IISProcessManager.ExecuteProcess("taskkill", "/pid " + ProcessId); ProcessId = NOT_FOUND; } catch (Exception) { Status = SiteStatus.Error; throw new InvalidOperationException("Could not start the process!"); } Status = SiteStatus.Stopped; }
public void RefreshSiteList() { var iisSites = IISConfigReader.ReadXmlFromConfig(App.IISExpressConfig); IISProcessManager.AssignProcessIds(iisSites); Sites.Clear(); foreach (var site in iisSites) { Sites.Add(site); } Sites.ResetBindings(); _eventAggregator.Publish(new BalloonNotificationEvent { Title = "Refresh", Message = "List of sites was refreshsed" }); }