简体   繁体   English

System.Private.CoreLib.ni中发生了“ System.MissingMethodException”

[英]'System.MissingMethodException' occurred in System.Private.CoreLib.ni

I am working on a project (Visual Studio 2015 update 3) where I am using Entity framework core with MySQL. 我正在开发一个项目(Visual Studio 2015更新3),其中我在MySQL中使用实体框架核心 I am able to write to data to my database, but when trying to query data using DbSet<T>.Find(...) or FirstOrDefault I get this exception: 我能够将数据写入数据库,但是当尝试使用DbSet<T>.Find(...)FirstOrDefault 查询数据时,出现此异常:

An exception of type 'System.MissingMethodException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code System.Private.CoreLib.ni.dll中发生了类型为'System.MissingMethodException'的异常,但未在用户代码中处理

Additional information: Method not found: 'Void Microsoft.EntityFrameworkCore.Query.QueryContextFactory..ctor(Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager, Microsoft.EntityFrameworkCore.Internal.IConcurrencyDetector, Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IChangeDetector)' 附加信息:找不到方法:'无效Microsoft.EntityFrameworkCore.Query.QueryContextFactory..ctor(Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager,Microsoft.EntityFrameworkCore.Internal.IConcurrencyDetector,Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IChangeDetector)'

I tried to update all the packages from NuGet packages manager, with no success. 我试图从NuGet软件包管理器更新所有软件包,但没有成功。 This question may apear like semi duplicate, but it is NOT, no solution worked for me. 这个问题可能像半重复一样出现,但不是,没有解决方案对我有用。 Any ideas? 有任何想法吗? Thanks in advance! 提前致谢!

OK it seems to be a bug in MySQL -> entity framework adapter MySql.Data.EntityFrameworkCore . 好的,这似乎是MySql.Data.EntityFrameworkCore >实体框架适配器MySql.Data.EntityFrameworkCore I downgraded from 7.0.6-IR31 to 6.10.1-beta and everything works fine now! 我从7.0.6-IR31降级为6.10.1-beta ,现在一切正常!

Just in case someone finds this issue. 以防万一有人发现此问题。 In Enterprise edition, this issue is not there as of now. 在企业版中,此问题目前不存在。 This bug is still open in community edition. 该错误在社区版中仍然打开。 It doesn't support all ef core frameworks versions as of now. 到目前为止,它不支持所有ef核心框架版本。 Please refer following referenced links for supported versions. 请参考以下参考链接以获取受支持的版本。

Following is the reported issue. 以下是报告的问题。 https://bugs.mysql.com/bug.php?id=89855 https://bugs.mysql.com/bug.php?id=89855

Following is the version support table. 以下是版本支持表。 https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core.html https://dev.mysql.com/doc/connector-net/zh/connector-net-entityframework-core.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM