摘要:
使用vscode调试c#程序代码
通用于windows,mac,linux
🔷添加VS Code插件,安装C#,C# Dev kit插件
🔷添加lanuch.json配置
{
"version": "0.2.0",
"configurations": [
{
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"name": ".NET Core Launch (console)",
"program": "${workspaceFolder}/ConsleVSCode/bin/Debug/net8.0/ConsleVSCode.exe",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
}
]
}
🔷新增 tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}"
],
"problemMatcher": "$msCompile"
}
]
}
完成以上设置后,即可正常调试C#代码



