protected override void OnStart(string[] args) { try { var temp = new ConfigurationBuilder() .AddJsonFile("config.json") .AddJsonFile("hosting.json", true) .Build(); var configProvider = new MemoryConfigurationProvider(); configProvider.Add("server.urls", temp["WebServerAddress"]); configProvider.Add("webroot", temp.Get<string>("webroot", "wwwroot")); var config = new ConfigurationBuilder() .Add(configProvider) .Build(); var builder = new WebHostBuilder(config); builder.UseServer("Microsoft.AspNet.Server.Kestrel"); builder.UseStartup<Startup>(); var hostingEngine = builder.Build(); _application = hostingEngine.Start(); } catch (Exception ex) { Debug.WriteLine("error in OnStart: " + ex); throw; } }