vscode launch.json调试并打开特定的URL [英] vscode launch.json debug and open specific url
问题描述
给出以下自动生成的Visual Studio Code launch.json配置:
Given the following auto-generated Visual Studio Code launch.json config:
我希望以此将浏览器启动到 localhost: 5000 / swagger
当我调试时,但是我尝试了六种不同的方法,但是没有任何效果。它只是打开到 localhost:5000
。我在这里想念什么?除了击中Ctrl + space来查看列表之外,没有关于所有可用属性的常规文档(我可以找到)。
I'd like this to launch the browser to localhost:5000/swagger
when I debug, but I've tried half a dozen different things and nothing works. It just opens to localhost:5000
. What am I missing here? There's no general documentation (that I could find) on all of the attributes available aside from hitting Ctrl+space to see a list, which doesn't help much.
I省略了我失败的尝试,以使它按我的意愿工作。
I left out my failed attempts at getting this to work how I want...
{
"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"
}
}
推荐答案
我尝试了以下操作,并且似乎可行
I tried the following and it seems to work
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}/swagger",
这篇关于vscode launch.json调试并打开特定的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!