给定以下自动生成的 Visual Studio Code launch.json 配置:
我想启动浏览器localhost:5000/swagger
当我调试时,但我尝试了六种不同的方法,但没有任何效果。它只是打开到localhost:5000
。我在这里缺少什么?除了按 Ctrl+空格键查看列表之外,没有关于所有可用属性的通用文档(我可以找到),这没有多大帮助。
我遗漏了我失败的尝试,让这个按照我想要的方式工作......
{
"name": "Launch Demo.Api",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/Demo.Api/bin/Debug/netcoreapp2.1/Demo.Api.dll",
"args": [],
"cwd": "${workspaceRoot}/Demo.Api",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}