首页 > 解决方案 > 无法加载程序集 System.Runtime.CompilerServices.Unsafe

问题描述

我正在开发 .NET Core 应用程序 + NET Standard 2 库。该库使用 EntityFrameworkCore.SQLServer。当我添加 EntityFrameworkCore.PostgreSQL 时,启动期间的应用程序给了我一个错误:

... Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExce ptionInterceptor.MoveNext(CancellationToken cancelToken)System.IO.FileLoadException:无法加载文件或程序集'System.Runtime.CompilerServices.Unsafe,版本= 4.0。 4.1,文化=中立,PublicKeyToken=b03f5f7f11d50a3a'。找到的程序集的清单定义与程序集引用不匹配。(HRESULT 异常:0x80131040)文件名:'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Npgsql.NpgsqlWriteBuffer.Write[T](T value)

我已重新安装 EntityFrameworkCore.PostgreSQL - 未修复。也许我可以将此程序集添加到我的库中,但我可以从哪里获得它:'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, C ulture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

谢谢。

标签: entity-framework.net-core.net-standard-2.0

解决方案


推荐阅读