- launchSettings.json文件中,声明多个profiles。
- 其中一个profile的commandName得是"Project",用于PowerShell启动。
- VS调试时,使用另一个profile。
- VS调试和PowerShell启动时,一个使用Debug,一个使用Release
PowerShell调用命令:
- cd D:\VSProjects\ASP.NETCORE_TEST\ASP.NETCORE_TEST 切换到项目所在目录
- dotnet run --configuration Release --launch-profile "zhao" 指定版本为Release,指定profile为zhao
- 另一种:dotnet run -c Release --urls http://0.0.0.0:5010
Cmd调用命令:
- dotnet host.dll urls=http://0.0.0.0:5010