Ubuntu - Segmentation Fault Error upon running dotnet new console

Viewed 1774

When I try to run 'dotnet new console' in either the Ubuntu or VS Code Terminal, I get the following error

Segmentation fault (core dumped)

Running it in the Ubuntu Terminal seems to give more information, looks like it's failing to do the 'dotnet restore' that automatically runs when you do 'dotnet new console'

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)

Running dotnet restore manually just gives the segfault error

Version of Ubuntu is 21.04, I have already installed everything as per https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2104-

Another thing to note is that I can build and run C Sharp applications fine in Monodevelop, and I can run non .NET languages such as Python fine in VS Code

Any ideas / assistance would be appreciated, thanks

2 Answers

I seem to have fixed this by uninstalling both .Net and VS Code via the instructions on Microsofts website, then installing again via the terminal commands / .deb file from Microsofts website

I had previously installed VS Code from the Ubuntu App Store, rather than via the .Deb from Microsoft

Related