修改.net core 运行端口

ASPNETCORE_URLS environment variable is ignored by "dotnet run"

 

 

  1. dotnet new web
  2. set ASPNETCORE_URLS=http://127.0.0.1:0
  3. 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.
  1. 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.

posted on 2018-08-08 16:33  马什么梅  阅读(324)  评论(0编辑  收藏  举报

导航