Exemplo n.º 1
0
        static IHost StartTestApp()
        {
            var args = new[]
            {
                "--urls", "http://127.0.0.1:0",
                "--applicationpath", typeof(TestApp.Startup).Assembly.Location,
            };

            var host = DevHostServerProgram.BuildWebHost(args);

            RunInBackgroundThread(host.Start);
            return(host);
        }
Exemplo n.º 2
0
        protected override IWebHost CreateWebHost()
        {
            ContentRoot = FindSampleOrTestSitePath(
                typeof(TProgram).Assembly.FullName);

            var args = new List <string>
            {
                "--urls", "http://127.0.0.1:0",
                "--contentroot", ContentRoot,
                "--pathbase", PathBase
            };

            if (!string.IsNullOrEmpty(Environment))
            {
                args.Add("--environment");
                args.Add(Environment);
            }

            return(DevHostServerProgram.BuildWebHost(args.ToArray()));
        }