[英]Entity Framework 6.3 in .NET6
我在使用 .NET 6 的 EF 6(不是 EF Core)时遇到问题,一切正常,除非我尝试添加迁移。
我收到以下错误:
The type initializer for 'System.Data.Entity.Migrations.DbMigrationsConfiguration`1' threw an exception.
---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
这可能是什么原因?
对于出于遗留原因仍希望将 EF 6.3 与 .NET Core 一起使用的其他人。
将此添加到包含您的配置文件的项目中。
<PropertyGroup>
<GenerateRuntimeConfigurationFiles>True</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
您现在应该能够执行 ef 命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.