Troubleshooting: 'The .NET Core SDK cannot be located.' errors
Introduction
有时 VS Code 打开后会出现下面的报错内容:
The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.
这意味着程序想要运行 dotnet
命令,但是 dotnet
没能在程序的 PATH
中找到。
如果没有下载 .NET Core SDK,可以通过链接进行下载。
如果已经下载 .NET Core SDK,意味着 dotnet
(Linux and macOS) 或 dotnet.exe
(Windows) 不在路径中,至少不在拓展程序的路径中。
General troubleshooting steps on Linux/Mac
首先在终端运行 which dotnet
命令,如果生成一条路径,则可以尝试从终端启动 VS Code。
先打开 VS Code,然后按下快捷键 Command + Shift + P
,进入命令面板后输入 shell 并选择 Install ‘code’ command in PATH,之后可以在终端中通过 code .
命令打开 VS Code。
References
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
Anonymous Comment
You don't need to delete empty lines. Comment directly for the best display effect.