c# - VS 代码错误 "The .NET CLI tools cannot be located..."

标签 c# visual-studio-code

Visual Studio Code 告诉我“找不到 .NET CLI 工具。将不会启用 .NET Core 调试。确保 .NET CLI 工具已安装并且位于路径中。”。这可以防止任何代码完成等。我可以解决这个问题吗?

最佳答案

有时,即使在安装 .NET SDK 后,Visual Studio 警告仍然存在。这是因为需要在 .NET 可执行文件安装位置和 Visual Studio 路径之间创建链接/快捷方式/别名。

可执行文件很可能安装在 /usr/local/share/dotnet/dotnet 中。需要为 Visual Studio 创建指向 usr/local/bin 的符号链接(symbolic link)。

要在终端中使用上述位置创建该链接:

$ ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/

对于 Ubuntu 和 Snap,请改用它:

$ sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/

关于c# - VS 代码错误 "The .NET CLI tools cannot be located...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50454088/

相关文章:

c# - Windows Mobile 6.5 手势和 C# 2.0 应用程序

c# - 从右到左括号显示错误

c# - 来自非托管内存的 byte[] 数组

visual-studio-code - 为什么我在linux上找不到vscode live share扩展?

node.js - 在 azure 上部署应用程序期间,Visual Studio 总是卡住

reactjs - 使用 typescript react CRA 不适用于 eslint

c# - Unity - 使用新输入系统/角色 Controller 让角色看着鼠标

c# - unity EditorGUI.PropertyField 无法完全禁用数组或列表

c++ - 如何在 VS Code 中为 C++ 开发进行初始设置?

python - Pylint 加载插件在 VS 代码中失败