术语“dotnet”未被识别。

3

我一直在尝试解决Visual Studio Code中出现的以下错误,感到非常沮丧:

The term 'dotnet' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and
try again. 
At line:1 char:7 + dotnet <<<<  --info
    + CategoryInfo          : ObjectNotFound: (dotnet:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我已经进行了广泛的研究,但并未找到解决方法。我尝试了许多其他人的解决方法,但错误仍然存在。我已经安装、修复和卸载了必要的安装文件数次……但错误仍然存在!

我的操作系统是Win7 Pro,已更新至最新版本。使用的软件为VS Code 1.28.2和NET Core SDK 2.1.403。

期待您的任何建议/指针/见解。


你似乎正在运行一个PowerShell脚本。你能否在问题旁边发布它? - amdmax
感谢您的回复。目前,我没有运行PowerShell脚本,只是在命令提示符下输入“_dotnet --info_”... - MARz
你也可以查看 https://dev59.com/eVkR5IYBdhLWcg3w9Ryt - sashoalm
2个回答

2

感谢您的输入。我相信我有正确的路径信息。这是它:_;C:\Users\Matt\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Matt.dotnet\tools_ - MARz
我现在没有Windows,但是相当确定dotnet cli应该在这个路径下:C:\Program Files\dotnet\sdk\x.x.x\,请确认你的机器上的路径,然后将其添加到你的PATH环境变量中,重新启动VS Code,应该就可以了。 - Niels

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接