Пример #1
0
        public ServiceAppHost()
        {
            InitializeComponent();
            XmlConfigurator.Configure();
            var coreBuilder = HostConfigurator.GetBuilder();
            //HostConfigurator.LoadHostedApps(typeof(IWebService).Assembly, true, coreBuilder);
            var core = coreBuilder.Build();

            _host = new AppHost(core);
        }
Пример #2
0
        private static void RunConsole()
        {
            var coreBuilder = HostConfigurator.GetBuilder();
            //HostConfigurator.LoadHostedApps(typeof(Program).Assembly, false, coreBuilder);
            //HostConfigurator.LoadHostedApps(typeof(IWebService).Assembly, true, coreBuilder);

            var core = coreBuilder.Build();
            var host = new AppHost(core);

            host.Start();

            Console.WriteLine("Any key to stop");
            Console.ReadKey();

            host.Stop();

            Console.WriteLine("Any key to exit");
            Console.ReadKey();
        }