gpt4 book ai didi

c# - Entity Framework 代码优先迁移

转载 作者:太空狗 更新时间:2023-10-30 00:32:03 26 4
gpt4 key购买 nike

运行以下命令

pm> Update-Database

出现以下错误

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.SqlServer.SqlProviderServices' threw an exception. ---> System.TypeLoadException: Method 'ExecuteAsync' in type 'System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy' from assembly 'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' does not have an implementation.

最佳答案

您的 EF 版本和项目版本不相等。您的 Entity Framework 是 .Net 4 的第 6 版,但您的项目使用 .net 4.5.net 版本 4.5 的项目必须使用 EF for .Net4.5

关于c# - Entity Framework 代码优先迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20513621/

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