Repro Steps
dotnet new web
set ASPNETCORE_URLS=http://127.0.0.1:0
dotnet run (note ASPNETCORE_URLS is ignored)
> dotnet run
Using launch settings from D:\Temp\foo2\Properties\launchSettings.json...
Hosting environment: Development
Content root path: D:\Temp\foo2
Now listening on: https://localhost:5001
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
dotnet run --no-launch-profile (note ASPNETCORE_URLS is used)
> dotnet run --no-launch-profile
Hosting environment: Production
Content root path: D:\Temp\foo2
Now listening on: http://127.0.0.1:50897
Application started. Press Ctrl+C to shut down.
https://github.com/dotnet/cli/blob/d0780d81e571abfcdcd1ed2ab85f0cc4a155528e/src/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs#L18-L21
For me to run successfully with a specified port (44360) on SSL on Windows 10 from
cmd:1.
dotnet dev-certs https --trust(if not installed) 2.set ASPNETCORE_URLS=https://localhost:443603.dotnet run --no-launch-profileNote this logic is built into the dotnet run tooling, it’s not any code from the aspnet org. This bug would need to be moved accordingly.