{
    // VS Code 启动与调试配置
    // 依赖 C# 扩展（OmniSharp 或 C# Dev Kit）提供 coreclr 调试器。
    // 文档：https://code.visualstudio.com/docs/csharp/debugger-settings
    "version": "0.2.0",
    "configurations": [
        {
            // 标准调试启动：编译并启动 Host，命中断点，浏览器自动打开首页
            "name": ".NET Core Launch (Host)",
            "type": "coreclr",
            "request": "launch",
            "program": "dotnet",
            "args": [
                "run",
                "--project",
                "${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
                "--no-launch-profile"
            ],
            "cwd": "${workspaceFolder}",
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development",
                "ASPNETCORE_URLS": "http://localhost:5190"
            },
            "stopAtEntry": false,
            "console": "internalConsole",
            "preLaunchTask": "build",
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "\\bNow listening on:\\s+(https?://\\S+)",
                "uriFormat": "%s"
            }
        },
        {
            // 热重载调试启动：自动编译、自动重启、断点保留；迭代 Web / 控制器层时首选
            "name": ".NET Core Watch (Host)",
            "type": "coreclr",
            "request": "launch",
            "program": "dotnet",
            "args": [
                "watch",
                "run",
                "--project",
                "${workspaceFolder}/src/Flyshot.Server.Host/Flyshot.Server.Host.csproj",
                "--no-launch-profile"
            ],
            "cwd": "${workspaceFolder}",
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development",
                "ASPNETCORE_URLS": "http://localhost:5190"
            },
            "stopAtEntry": false,
            "console": "integratedTerminal",
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "\\bNow listening on:\\s+(https?://\\S+)",
                "uriFormat": "%s"
            }
        },
        {
            // 附加到正在运行的 dotnet 进程（如已手动 `dotnet run` 或 Windows Service 模式）
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}
