VS code 中的 launch.json 文件属性值
.NET Core 新建工程中自动生成的 launch.json 配置文件
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/myapp.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
,]
}
关于其中几个字段的含义(摘自网络)
console: 用于启动程序的指定控制台。默认为 internalConsole
- internalConsole: VS Code Debug 控制台 (输入不被支持)
- integratedTerminal: VS Code 集成终端
- externalTerminal: 可以在用户设置中配置的外部终端
stopOnEntry: 启动后自动暂停程序
实际尝试
"console": "internalConsole",
使用内置调试控制台,默认设置,不过好像不支持输入,可以改为,
"externalTerminal"
使用外部控制台,也就是CMD命令符窗口。
"integratedTerminal"
使用集成终端,也就是Windows PowerShell。