首页 > 解决方案 > ASP.NET 核心 3.1:将类库添加到 Project_MissingMethodException:找不到方法:'Boolean Microsoft.EntityFrameworkCore.Migrations

问题描述

我正在处理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)  

标签: asp.net-core

解决方案


我发现一个解决方案可以帮助解决错误:

MissingMethodException:找不到方法:'Boolean Microsoft.EntityFrameworkCore.Migrations.IMigrationsModelDiffer.HasDifferenc

https://github.com/dotnet/efcore/issues/22687


推荐阅读