示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            var startup = new web.Startup();

            startup.UnityConfigured += Web_UnityConfigured;
            WebAPI = WebApp.Start("http://localhost:10080", startup.Configuration);
            //CancellationSource = new CancellationTokenSource();

            //Hostingtask = Task.Factory.StartNew( () =>
            //{
            //	WebHostActive = true;

            //	//Console.WriteLine( "hosting ffoqsi" );

            //	//var host = new WebHostBuilder()
            //	//	.UseKestrel()
            //	//	.UseContentRoot( pathToContentRoot )
            //	//	.UseIISIntegration()
            //	//	.UseStartup<Startup>()
            //	//	.Build();

            //	//host.Run( CancellationSource.Token );

            //	WebHostActive = true;
            //} );
        }
示例#2
0
        public ApiHost Start()
        {
            if (WebAPI != null)
            {
                Stop();
            }

            var startup = new web.Startup();

            startup.UnityConfigured += Web_UnityConfigured;
            WebAPI = WebApp.Start("http://localhost:10080", startup.Configuration);
            return(this);
        }