c# - Visual Studio Code C# 调试问题(终端进程无法启动:shell 可执行文件“dotnet”的路径不是符号链接的文件。)
问题描述
我使用创建了一个工作区dotnet new console
,编写了一些代码。但是,当我尝试使用 Visual Studio 代码中的“运行/开始调试”选项开始调试它时,它会失败并显示以下消息:
执行任务:dotnet build /home/MY USERNAME/Desktop/Codes/C#/Console/Console.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary
终端进程启动失败:shell 可执行文件“dotnet”的路径不是文件的符号链接。
终端将被任务重用,按任意键关闭它。
在终端中使用该dotnet run
命令可以正常工作,没有任何问题。但是由于某种原因,使用启动调试选项失败。我真的不想每次想启动程序时都输入这个命令。
这是dotnet --info
命令的结果:
.NET Core SDK (reflects global.json if exists):\
Version: 3.1.302\
Commit: 41faccf259
Runtime Environment:\
OS Name: ubuntu\
OS Version: 20.04\
OS Platform: Linux\
RID: linux-x64\
Base Path: /usr/share/dotnet/sdk/3.1.302/
Host (useful for support):\
Version: 3.1.6\
Commit: 3acd9b0cd1
.NET Core SDKs installed:\
3.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:\
Microsoft.AspNetCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]\
Microsoft.NETCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:\
https://aka.ms/dotnet-download
我已经对结果进行了一些翻译,它可能与原始输出不完全匹配
解决方案
看来这个帖子是不会回复的。我找到了解决它的方法。在“tasks.json”文件中,我将命令“dotnet”替换为“/usr/bin/dotnet”,现在它工作正常。但我认为实际问题与路径变量有关,我的解决方案只是暂时的。
推荐阅读
- python - Pandas:将输出值从具有 NaN 值的列中的浮点数更改为整数
- angular - 可扩展行内具有嵌套材料表的材料表
- javascript - Discord.js Slash 命令名称无效
- pandas - 为什么即使 iterator = False,Pandas read_CSV 也会返回 TextFileReader?
- java - 在 Vaadin 框架中,如何让客户端时区用于渲染显示的第一页
- javascript - Vue.js Javascript 框架和打印而不打印对话框
- jsf - 我不知道如何将 html 页面转换为 xhtml(jsf) ,当我运行该页面时,我没有为名称定义标签:输入
- docker - Ubuntu 20.04 上的安全 Tileserver-GL
- solr - 如果我们有很多 indexed=true 和 stored=false 的字段,solr 集合大小会增加吗
- sql - Sql祖父-父-子关系