我在Ubuntu 18.04上安装了Visual Studio Code 1.56.2来开发Python。
几天前,我安装了“Linux上C#编码的.NET核心”,这样我就可以用Visual Studio Code编写C#代码了。
当我尝试运行"Program.cs“(hello world)应用程序时,我得到一个弹出窗口,提示错误”你没有用于调试C#的扩展。我们应该在市场中找到C#扩展吗?“
我已经安装了"C# for Visual Studio Code (powered by OmniSharp).microsoft“,如下所示:

这是我的工作区结构:

如果您能帮助我解决这个问题,我将不胜感激。
发布于 2021-05-25 09:54:18
确保您的项目/解决方案根目录中名为.vscode的文件夹中包含launch.json和task.json。
如果没有-t,您可以进入菜单Run > Add Configuration...

它应该会自动创建文件,但是如果你不能,这里有一个这些文件内容的示例(你需要调整到你的本地文件系统/project/version值)
tasks.json:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "shell",
"args": [
"build",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net5.0/net.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}https://stackoverflow.com/questions/67678278
复制相似问题