gpt4 book ai didi

asp.net-core - ASP.NET 核心 3.1 :Adding Classes Libraries to the Project_ MissingMethodException: Method not found: 'Boolean Microsoft. EntityFrameworkCore.Migrations

转载 作者:行者123 更新时间:2023-12-05 08:30:13 36 4
gpt4 key购买 nike

我正在处理 asp.net-core 3.1 项目,我为我的项目添加了 3 个类库来分离访问数据、模型类和实用程序类我解决了匹配文件夹等问题。但是当我运行我的项目时,我得到了这个错误:

MissingMethodException: Method not found: 'Boolean Microsoft.EntityFrameworkCore.Migrations.IMigrationsModelDiffer.HasDifferences(Microsoft.EntityFrameworkCore.Metadata.IModel, Microsoft.EntityFrameworkCore.Metadata.IModel)'.


Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext
httpContext)
System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine
stateMachine)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<TStateMachine>(ref TStateMachine
stateMachine)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext
httpContext)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

最佳答案

对我来说,答案是确保我所有的 EF 包都指向同一个 3.1.X 版本。我无意中瞄准了一个包含缺失方法的 5.0.0 EF 包:

https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.migrations.imigrationsmodeldiffer.hasdifferences?view=efcore-5.0

关于asp.net-core - ASP.NET 核心 3.1 :Adding Classes Libraries to the Project_ MissingMethodException: Method not found: 'Boolean Microsoft. EntityFrameworkCore.Migrations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65159434/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com