VSCode launch ASP.NET Core app on a specific port

后端 未结 1 780
执笔经年
执笔经年 2020-12-31 00:33

From launch.json, what is the correct way to launch an ASP.NET Core on a specific port? For instance, when I run my .NET Core app, VS Code, hosts it on localhost:5000, but I

相关标签:
1条回答
  • 2020-12-31 01:19

    You can config it via environment variable ASPNETCORE_URLS

    macOS:

    export ASPNETCORE_URLS=http://localhost:5050
    

    windows:

    set ASPNETCORE_URLS=http://localhost:5050
    

    or add this to launch.json

      "env": {
        "ASPNETCORE_URLS": "http://localhost:5050"
      }
    

    If you don't want to specify the hostname, you can use * instead

    http://*:5050
    
    0 讨论(0)
提交回复
热议问题