Ejemplo n.º 1
0
 /// <summary>Starts an instance of the local web server.</summary>
 public static void StartWebServer()
 {
     if (s_webserver == null)
     {
         s_webserver = new IISExpressWebserver();
         s_webserver.Start(LocalWebServerHelper.TargetPhysicalPath, LocalWebServerHelper.LocalPortNumber);
     }
 }
Ejemplo n.º 2
0
        private static void StartWebServer()
        {
            string projectPath = File.ReadAllLines("ClientTestProjectPath.txt")[0];
            string webSitePath = Path.GetFullPath(Path.Combine(projectPath, @"..\..\..\Test\WebsiteFullTrust"));

            if (!Directory.Exists(webSitePath))
            {
                throw new FileNotFoundException($"Website not found at {webSitePath}");
            }

            s_webServer = new IISExpressWebserver();
#if VBTests
            s_webServer.Start(webSitePath, 60000);
#else
            s_webServer.Start(webSitePath, 60002);
#endif
        }
Ejemplo n.º 3
0
        /// <summary>Performs cleanup and ensures that there are no active web servers.</summary>
        public static void Cleanup()
        {
            if (s_webserver != null)
            {
                // The local web server does not respond to CloseMainWindow.
                Trace.WriteLine("Closing web server process...");

                try
                {
                    s_webserver.Stop();
                }
                catch (InvalidOperationException)
                {
                    Trace.WriteLine("Unable to kill local web server process.");
                }
            }

            s_webserver     = null;
            localPortNumber = -1;
        }