Hier ist eine minimale Konsolen-App, um es zu beweisen:
Code: Select all
using System.Net;
namespace LaunchTrouble;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine($"ASPNETCORE_URLS - {Environment.GetEnvironmentVariable("ASPNETCORE_URLS")}");
Console.WriteLine($"ASPNETCORE_HTTPS_PORT - {Environment.GetEnvironmentVariable("ASPNETCORE_HTTPS_PORT")}");
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
// webBuilder.UseStartup();
webBuilder.UseKestrel(options =>
{
options.Listen(IPAddress.Any, 5111);
options.Listen(IPAddress.Any, 5222, listenOpts =>
{
listenOpts.UseHttps();
});
});
// Basic pipeline to avoid Startup overhead
webBuilder.Configure(_ => {});
})
.Build()
.Run();
}
}
Code: Select all
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"Dev": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Code: Select all
ASPNETCORE_URLS - https://localhost:5001/;http://localhost:5000/