private static void LaunchServerLight()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            s_ServerLightInstance = new ServerLight();
            s_ServerLightInstance.StartWebServer();

            //starting remotint API
            Uri baseAddress = new Uri(GetAppSettingbasePipeRecorderService());
            //m_serviceHost = new ServiceHost(s_ServerLightInstance, baseAddress);
            //m_serviceHost.AddServiceEndpoint(typeof(IServerLight), new NetNamedPipeBinding(NetNamedPipeSecurityMode.None), baseAddress);
            //m_serviceHost.Open();


            VoidMethodDelegate v = delegate
            {
                NotifyIconForm.Instance.NotifyIcon.ShowBalloonTip(1000, "ServerLight", s_ServerLightInstance.WebServerUri.ToString(), ToolTipIcon.Info);
                string path = s_ServerLightInstance.ServerPhysicalPath;
                if (path.Length >= 60)
                {
                    path = path.Substring(s_ServerLightInstance.ServerPhysicalPath.Length - 60, 60);
                }
                NotifyIconForm.Instance.NotifyIcon.Text =
                    path;
                s_serviceContainerHelper.AddService <IMenuService>(NotifyIconForm.Instance);
                s_serviceContainerHelper.AddService <IServerLight>(s_ServerLightInstance);

                PluginLoader pluginLoader = new PluginLoader(AppDomain.CurrentDomain.BaseDirectory);
                pluginLoader.LoadPluginAssemblies(s_serviceContainerHelper);

                ServerLightInstance.LaunchDefaultWebBrowser();
                Application.Run(NotifyIconForm.Instance);
            };

            v.BeginInvoke(delegate(IAsyncResult result)
            {
                VoidMethodDelegate vv = (VoidMethodDelegate)result.AsyncState;
                vv.EndInvoke(result);
                s_Event.Set();
            }, v);

            s_Event.WaitOne();
            s_Event.Close();

            s_ServerLightInstance.StopWebServer();
            //if (m_serviceHost != null)
            //{
            //    m_serviceHost.Close();
            //}
        }
        private static void LaunchServerLight()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            s_ServerLightInstance = new ServerLight();
            s_ServerLightInstance.StartWebServer();

            //starting remotint API
            Uri baseAddress = new Uri(GetAppSettingbasePipeRecorderService());
            //m_serviceHost = new ServiceHost(s_ServerLightInstance, baseAddress);
            //m_serviceHost.AddServiceEndpoint(typeof(IServerLight), new NetNamedPipeBinding(NetNamedPipeSecurityMode.None), baseAddress);
            //m_serviceHost.Open();

            VoidMethodDelegate v = delegate
                                       {
                                           NotifyIconForm.Instance.NotifyIcon.ShowBalloonTip(1000, "ServerLight", s_ServerLightInstance.WebServerUri.ToString(), ToolTipIcon.Info);
                                           string path = s_ServerLightInstance.ServerPhysicalPath;
                                           if(path.Length >= 60)
                                           {
                                               path = path.Substring(s_ServerLightInstance.ServerPhysicalPath.Length - 60, 60);
                                           }
                                           NotifyIconForm.Instance.NotifyIcon.Text =
                                               path;
                                           s_serviceContainerHelper.AddService<IMenuService>(NotifyIconForm.Instance);
                                           s_serviceContainerHelper.AddService<IServerLight>(s_ServerLightInstance);

                                           PluginLoader pluginLoader = new PluginLoader(AppDomain.CurrentDomain.BaseDirectory);
                                           pluginLoader.LoadPluginAssemblies(s_serviceContainerHelper);

                                           ServerLightInstance.LaunchDefaultWebBrowser();
                                           Application.Run(NotifyIconForm.Instance);
                                       };

            v.BeginInvoke(delegate(IAsyncResult result)
                              {
                                  VoidMethodDelegate vv = (VoidMethodDelegate) result.AsyncState;
                                  vv.EndInvoke(result);
                                  s_Event.Set();
                              }, v);

            s_Event.WaitOne();
            s_Event.Close();

            s_ServerLightInstance.StopWebServer();
            //if (m_serviceHost != null)
            //{
            //    m_serviceHost.Close();
            //}
        }