Problem on configuring vscode for C#: it doesn't generate launch.json and tasks.json

huangapple go评论62阅读模式
英文:

Problem on configuring vscode for C#: it doesn't generate launch.json and tasks.json

问题

我正在尝试使用VS Code准备C#调试环境。我正在按照Tutorial: Create a .NET console application using Visual Studio Code中的步骤进行操作。然而,在配置控制台应用程序后,当我选择“.NET 5+和.NET Core”时,什么都没有发生。

文档中提到如下:

注意
如果您没有看到提示,或者意外地没有选择是,请按照以下步骤创建launch.json和tasks.json:
从菜单中选择Run > Add Configuration。
在选择环境提示中选择.NET 5+和.NET Core。

我按照说明操作了,但什么都没有发生。没有json文件,也没有错误或日志,没有线索。
我该如何在VS Code中设置C#?

注意:我在多台计算机上尝试过(win10/win11),所有计算机都出现相同的结果。

英文:

I'm trying to prepare C# debugging environment with vscode. I'm following Tutorial: Create a .NET console application using Visual Studio Code. However, nothing happens when I select ".NET 5+ and .NET Core" after configured console app.

Problem on configuring vscode for C#: it doesn't generate launch.json and tasks.json

The document I'm reffering says as follows:

> Note
>
> If you don't get the prompt, or if you accidentally dismiss it without selecting Yes, do the following steps to create launch.json and tasks.json:
>
> Select Run > Add Configuration from the menu.
> Select .NET 5+ and .NET Core at the Select environment prompt.

I followed the instruction but nothing happened. No json, no error or log, no clue.
How can I setup vscode for C#?

note: I tried this on multiple computers (win10/win11). Same result on all computers.

答案1

得分: 0

vscode在重新启动后询问我如下:

单击“是”会生成JSON文件,允许运行和调试。

注意:默认配置不允许标准输入。因此,我将控制台设置从internalConsole更改为integratedTerminal,如下所示:

英文:

vscode asked me after RESTART vscode as follows:
Problem on configuring vscode for C#: it doesn't generate launch.json and tasks.json

Clicking Yes let it generate json files, allows run and debug.

note: default configuration doesn't allow standard input. So I changed console setting to integratedTerminal from internalConsole as follows:

Problem on configuring vscode for C#: it doesn't generate launch.json and tasks.json

答案2

得分: 0

我遇到了相同的问题。我通过更新到 C# 扩展的先前版本来解决它(Ex-ID: ms-dotnettools.csharp)。

在 VSCode 上获取先前版本

英文:

I had the same problem. I fixed it by updating to the previous version of the C# extension.(Ex-ID: ms-dotnettools.csharp).
Getting previous version on VSCode

huangapple
  • 本文由 发表于 2023年2月26日 21:28:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572318.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定