C# Visual Studio代码C调试中的问题
我正在使用VS代码在C上运行一个小型控制台应用程序,即使我的PC上安装了SDK和C扩展,我也无法使用调试工具 当我在终端上运行dotnet run时,它可以工作,但当我尝试调试部分代码时,我得到: 我认为launch.json和tasks.json文件存在一些问题,但我不知道该怎么办 我也看过了,但问题仍然存在。tasks.jsonC# Visual Studio代码C调试中的问题,c#,debugging,visual-studio-code,C#,Debugging,Visual Studio Code,我正在使用VS代码在C上运行一个小型控制台应用程序,即使我的PC上安装了SDK和C扩展,我也无法使用调试工具 当我在终端上运行dotnet run时,它可以工作,但当我尝试调试部分代码时,我得到: 我认为launch.json和tasks.json文件存在一些问题,但我不知道该怎么办 我也看过了,但问题仍然存在。tasks.json { "version": "2.0.0", "tasks": [ { "label": "build",
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/ConsoleApplicationDemo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/ConsoleApplicationDemo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/ConsoleApplicationDemo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
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/ConsoleApplicationDemo.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
请参阅下面的URL:我想感谢您的建议,现在我在我的项目中使用的是Visual Studio not VS代码,调试工具工作得非常好
这看起来很不友好,如果你觉得gif很烦人,就忽略它吧,别傻了。你需要把你所有的东西都放进去,并向我们展示一个诚实使用比VS代码更好的东西的方法。本附文为社区版。