コード例 #1
0
        private static void RunAsCommandLine()
        {
            try
            {
                Console.CancelKeyPress += ConsoleCancelKeyPressEventHandler;

                servicesHost = new NortwindWCFServiceHostsManager(new ConsoleLogger());
                servicesHost.Start();

                Console.WriteLine("Server started. Press Ctrl+C to shutdown the server...");
                Console.WriteLine();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
                Console.WriteLine();
                Console.WriteLine(exception.StackTrace);
            }
            finally
            {
                UserInteractiveResetEvent.WaitOne();
            }
        }
コード例 #2
0
 public ServiceInstance()
 {
     this.InitializeComponent();
     this.manager = new NortwindWCFServiceHostsManager(new WindowsEventLogger());
 }