void Stop() { try { if (m_server != null) m_server.Stop(); } catch (Exception ex) { Trace.TraceError("Error shutting down:\r\n{0}", ex); } finally { m_server = null; } //Close(); }
void Start() { try { string dir = Paths.Expand(Settings.Default.ApplicationDirectory); dir = Path.GetFullPath(dir); m_server = new IISExpressController(); m_server.Start(Settings.Default.Port, dir); } catch { ShowError( "Cassini Managed Web Server failed to start listening on port " + Settings.Default.Port + ".\r\n" + "Possible conflict with another Web Server on the same port."); return; } }