コード例 #1
0
        protected override IWebHost CreateWebHost()
        {
            var sampleSitePath = FindSampleOrTestSitePath(
                typeof(TProgram).Assembly.GetName().Name);

            return(DevHostServerProgram.BuildWebHost(new string[]
            {
                "--urls", "http://127.0.0.1:0",
                "--contentroot", sampleSitePath,
                "--pathbase", PathBase
            }));
        }
コード例 #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()));
        }