gpt4 book ai didi

asp.net-core - VSCode 在特定端口上启动 ASP.NET Core 应用程序

转载 作者:行者123 更新时间:2023-12-02 02:44:07 25 4
gpt4 key购买 nike

从 launch.json 来看,在特定端口上启动 ASP.NET Core 的正确方法是什么?例如,当我运行 .NET Core 应用程序时,VS Code 将其托管在 localhost:5000 上,但我想将其托管在 localhost:5050 上。

提前致谢。

最佳答案

您可以通过环境变量ASPNETCORE_URLS进行配置

macOS:

export ASPNETCORE_URLS=http://localhost:5050

窗口:

set ASPNETCORE_URLS=http://localhost:5050

或将其添加到 launch.json

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

如果您不想指定主机名,可以使用 * 代替

http://*:5050

关于asp.net-core - VSCode 在特定端口上启动 ASP.NET Core 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39949752/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com