debugging - vscode launch.json 调试并打开特定的url

标签 debugging visual-studio-code

给定以下自动生成的 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/

相关文章:

angular - 使用 Visual Studio Code 调试不起作用

c++ - 调试断言失败 : _CrtIsValidHeapPointer(pUserData)

c - 如何使用输入 .asm 程序运行 lc3 的命令行版本并使用 gdb 对其进行分析?

visual-studio-code - VSCode - 一个任务可以调用另一个任务吗?

visual-studio-code - VSCode : What's that green statusbar terminal-ish icon in October 2019 release notes?

windows - 如何让 Clangd 在 Windows 上与 VS Code 一起正常工作

c++ - 如何纠正对运算符优先级的错误假设以消除代码的副作用?

python - 您如何自动启动/调试大型项目?

c# - VS 17 打破所有异常

c# - 如何让 VSCode 使用 C# 7 而不是 C# 4?