entity-framework - 无法加载程序集 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'
谢谢。
解决方案
推荐阅读
- react-native - 如何在不使用 React Native Mobile 中的选项卡导航器的情况下在屏幕中进行选项卡导航
- mysql - 将列整理从 utf8mb4_general_ci 更改为 utf8mb4_bin 损坏表
- c++ - 成员到指针变量仅在 Clang 中作为函数模板参数接受 -std=c++17
- javascript - 在 javascript 中将纪元日期转换为人类可读的日期时,我得到了 NaN / 不准确的年份数字。我该如何解决?
- python - Python:在未定义键时返回特定值
- sql-server - 存储过程选择语句中受影响的 SQL Server 日志记录行
- python - Python 保留函数。在计算中使用上一行的值
- apache-spark - pyspark.sql 无法实例化 HiveMetaStoreClient - noclassfound from org.apache.commons.dbcp.connectionfactory
- php - PHP 根据对象的值定义数组的键
- amazon-ec2 - 如何扩展新的 Windows 终端以支持 AWS?