From what I understand the correct way of setting listen ports for ASP Dotnet Core 2 preview 1/2 is by creating a Kestrel section in the appsettings.json in the following fo
I am using Program.cs and hosting.json file to configure Kestrel. Example:
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("hosting.json", optional: true, reloadOnChange: true)
.Build();
var host = new WebHostBuilder()
.UseConfiguration(config)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup();
hosting.json:
{
"urls": "http://localhost:4444;http://localhost:4445;"
}
This above is an example for the latest version dotnet core.
For earlier versions:
hosting.json:
{
"server.urls": "http://localhost:4444;http://localhost:4445;"
}