当我尝试在 Ubuntu 或 VS Code 终端中运行“dotnet new console”时,出现以下错误
Segmentation fault (core dumped)
在 Ubuntu 终端中运行它似乎提供了更多信息,看起来它无法执行在您执行“dotnet new console”时自动运行的“dotnet restore”
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /home/max/Programming/C Sharp/Hello World/Hello World.csproj...
Determining projects to restore...
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'
Segmentation fault (core dumped)
手动运行 dotnet restore 只会出现段错误
Ubuntu 的版本是 21.04,我已经按照 https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2104-
安装了所有东西另一件需要注意的是,我可以在 Monodevelop 中很好地构建和运行 C Sharp 应用程序,并且我可以在 VS Code 中很好地运行非 .NET 语言,例如 Python
任何想法/帮助将不胜感激,谢谢
答案 0 :(得分:0)
我似乎通过 Microsoft 网站上的说明卸载 .Net 和 VS Code,然后通过 Microsoft 网站上的终端命令/.deb 文件再次安装来解决此问题
我之前从 Ubuntu App Store 安装了 VS Code,而不是通过 Microsoft 的 .Deb