C# System.Data.SQLite.EF6.Migrations:加载不存在的错误版本(实体框架6,而非核心)

C# System.Data.SQLite.EF6.Migrations:加载不存在的错误版本(实体框架6,而非核心),c#,.net,sqlite,C#,.net,Sqlite,我尝试使用代码优先的方法来配置.NET4.5项目,其中包含 System.Data.SQLite System.Data.SQLite.EF6 System.Data.SQLite.EF6.Migrations 我已经在POC沙箱中成功地设置了所有内容,并且效果很好。按照生产项目中完全相同的配置,我在使用addmigration命令时遇到了错误 它显示它需要版本=1.0.104.0,但项目使用的是1.0.112.1。相应的DLL位于bin文件夹中,因此应该正确读取它们。另外,我已经检查了每个

我尝试使用代码优先的方法来配置.NET4.5项目,其中包含

  • System.Data.SQLite
  • System.Data.SQLite.EF6
  • System.Data.SQLite.EF6.Migrations
我已经在POC沙箱中成功地设置了所有内容,并且效果很好。按照生产项目中完全相同的配置,我在使用addmigration命令时遇到了错误

它显示它需要版本=1.0.104.0,但项目使用的是1.0.112.1。相应的DLL位于bin文件夹中,因此应该正确读取它们。另外,我已经检查了每个可能的位置,并确保所有dll文件都是1.0.112.1,包括GAC和csproj。不应该使用错误版本的SQLite.EF6

System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite.EF6, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.Data.SQLite.EF6, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
   at System.Data.SQLite.EF6.Migrations.SQLiteMigrationSqlGenerator..ctor()
   at School.ExcelAddin.Data.SQLiteDB.Configuration..ctor() in C:\School.ExcelAddin.Data.SQLiteDB\Configuration.cs:line 16
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Data.Entity.Migrations.Utilities.MigrationsConfigurationFinder.FindMigrationsConfiguration(Type contextType, String configurationTypeName, Func`2 noType, Func`3 multipleTypes, Func`3 noTypeWithName, Func`3 multipleTypesWithName)
   at System.Data.Entity.Infrastructure.Design.Executor.GetMigrationsConfiguration(String migrationsConfigurationName)
   at System.Data.Entity.Infrastructure.Design.Executor.ScaffoldInternal(String name, DbConnectionInfo connectionInfo, String migrationsConfigurationName, Boolean ignoreChanges)
   at System.Data.Entity.Infrastructure.Design.Executor.Scaffold.<>c__DisplayClass0_0.<.ctor>b__0()
   at System.Data.Entity.Infrastructure.Design.Executor.OperationBase.<>c__DisplayClass4_0`1.<Execute>b__0()
   at System.Data.Entity.Infrastructure.Design.Executor.OperationBase.Execute(Action action)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Could not load file or assembly 'System.Data.SQLite.EF6, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
System.IO.FileLoadException:无法加载文件或程序集'System.Data.SQLite.EF6,Version=1.0.104.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139'或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(来自HRESULT的异常:0x8013100)
文件名:“System.Data.SQLite.EF6,版本=1.0.104.0,区域性=neutral,PublicKeyToken=db937bc2d44ff139”
位于System.Data.SQLite.EF6.Migrations.SQLiteMigrationSqlGenerator..ctor()处
C:\School.ExcelAddin.Data.SQLiteDB.Configuration..ctor()中的School.ExcelAddin.Data.SQLiteDB\Configuration.cs:第16行
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
位于System.Data.Entity.Migrations.Utilities.MigrationConfigurationFinder.FindMigrationConfiguration(类型contextType、字符串配置TypeName、Func`2 NotType、Func`3 MultipleType、Func`3 NotTypeWithName、Func`3 MultipleType WithName)
位于System.Data.Entity.Infrastructure.Design.Executor.GetMigrationConfiguration(字符串MigrationConfigurationName)
位于System.Data.Entity.Infrastructure.Design.Executor.ScaffolInternal(字符串名称、DbConnectionInfo连接信息、字符串迁移配置名称、布尔值ignoreChanges)
在System.Data.Entity.Infrastructure.Design.Executor.Scaffold.c__DisplayClass0_0.b_0()中
在System.Data.Entity.Infrastructure.Design.Executor.OperationBase.c__DisplayClass4_0`1.b__0()中
位于System.Data.Entity.Infrastructure.Design.Executor.OperationBase.Execute(操作)
警告:程序集绑定日志记录已关闭。
要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。
注意:程序集绑定失败日志记录会带来一些性能损失。
要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog]。
无法加载文件或程序集“System.Data.SQLite.EF6,Version=1.0.104.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。定位的程序集清单定义与程序集引用不匹配。(来自HRESULT的异常:0x8013100)

我自己找到了一个解决方案System.Data.SQLite.EF6.从nuget迁移s正在使用nuget存储库中的System.Data.SQLite.EF6System.Data.SQLite的不同(旧)版本。新建SQLiteMigrationSqlGenerator实例时,它指向较旧版本的System.Data.SQLite.EF6(v1.0.104.0),该版本与当前加载的程序集(1.0.112.1)冲突。

我自己找到了一个解决方案System.Data.SQLite.EF6.从nuget迁移s正在使用nuget存储库中的System.Data.SQLite.EF6System.Data.SQLite的不同(旧)版本。新建SQLiteMigrationSqlGenerator实例时,它指向与当前加载的程序集(1.0.112.1)冲突的较旧版本的System.Data.SQLite.EF6(v1.0.104.0)