Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get error when I install .net core on Mac OS and Ubuntu

Tags:

.net-core

I follow the steps here: http://dotnet.github.io/getting-started/

But always get error like below:

On MAC OS

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

On Ubuntu 14.04 LTS

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.IO, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

at System.Console.WriteLine(String value)

at HelloWorldSample.Program.Main()

like image 688
Hunter Xue Avatar asked Nov 21 '15 09:11

Hunter Xue


People also ask

Is .NET Core compatible with Linux?

The . NET Core runtime allows you to run applications on Linux that were made with . NET Core but didn't include the runtime. With the SDK you can run but also develop and build .


1 Answers

Sounds like you missed the dotnet restore step. If not, check for errors that occurred during that step. It is what pulls in the extra packages via NuGet.

Unlike previous versions of .NET Framework, in which all of the assemblies were typically shipped together, .NET Core is very modular and your project will only pull in the ones it needs.

like image 174
Tobias J Avatar answered Oct 13 '22 01:10

Tobias J