Esempio n. 1
0
 public ServiceHostService(ServiceHostController serviceHostController)
 {
     serviceHostController.ValidateNonNull(nameof(serviceHostController));
     ServiceHostController = serviceHostController;
     var serviceName = serviceHostController.ServiceHostName;
     if (serviceName.Length > MaxNameLength)
         serviceName = serviceName.Substring(0, MaxNameLength);
     ServiceName = serviceName;
     DisplayName = serviceHostController.ServiceHostName;
     StartType = ServiceStartMode.Automatic;
     Account = ServiceAccount.LocalService;
     AutoLog = true;
 }
Esempio n. 2
0
        static void Main(params string[] arguments)
        {
            using (var service = new ServiceHostController(Local.Environment.CreateHost()))
            {
                service.Run(arguments);

                Console.WriteLine();

                TestClient("net");
                TestClient("ws");

                Console.WriteLine("Press any key to stop.");
                Console.ReadKey();
            }
        }