给定以下自动生成的 Visual Studio Code launch.json 配置:
我希望将浏览器启动到 localhost:5000/swagger
当我调试时,但我尝试了六种不同的东西,但没有任何效果。它只是打开 localhost:5000
.我在这里缺少什么?除了按 Ctrl+space 查看列表之外,没有关于所有可用属性的通用文档(我可以找到),这没有多大帮助。
我遗漏了我试图让它按照我想要的方式工作的失败尝试......
{
"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"
}
}
最佳答案
我尝试了以下操作,它似乎有效
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}/swagger",
关于debugging - vscode launch.json 调试并打开特定的url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51900193/