.net-core - 在 Mac OS 和 Ubuntu 上安装 .net core 时出错

标签 .net-core

我按照这里的步骤操作:http://dotnet.github.io/getting-started/
但总是得到如下错误:
在 MAC 操作系统上

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.


在 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()

最佳答案

听起来你错过了 dotnet restore步。如果不是,请检查在该步骤中发生的错误。这就是通过 NuGet 引入额外包的原因。

与以前版本的 .NET Framework(所有程序集通常一起交付)不同,.NET Core 是非常模块化的,您的项目只会引入它需要的那些。

关于.net-core - 在 Mac OS 和 Ubuntu 上安装 .net core 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33841971/

相关文章:

c# - 单独类库中数据注释的本地化

.net-core - 了解 Blazor 托管

c# - GZip/Deflate 压缩适用于 .NetCore 2.0,但不适用于 .Net 4.6.2

带有 .net framework 4.6.1 的 Asp.net Core 2.0 - 找不到引用程序集“.NETFramework/v4.6.1/Microsoft.CSharp.dll”

mongodb - 使用 DotNet Core 的 MongoDB 驱动程序时出现异常

c# - Couchbase 无法 MutateIn 多个带有 null 值的 upserts

.net-core - AutoMapper 8.0 缺少 GetPropertyMaps

c# - .net core 中的 Web API 请求查询参数值为空

c# - EF LINQ 查询 if 子句中抛出空引用异常

c# - 模拟一个对其参数有副作用的方法