SQL ITE 应用单元测试 未能加载文件或程序集
SQL ITE 应用单元测试
FileLoadException: 未能加载文件或程序集“System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)
=== 预绑定状态信息 ===
日志: DisplayName = System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139(Fully-specified)
日志: Appbase = file:///D:/Work2/Project/码云/jrzc/terminal-New/terminal-1.0Tests/bin
日志: 初始 PrivatePath = NULL
调用程序集: System.Data.SQLite.EF6.Migrations, Version=1.0.102.0, Culture=neutral, PublicKeyToken=null。
===
日志: 此绑定从 default 加载上下文开始。
日志: 正在使用应用程序配置文件: C:\Users\Administrator\AppData\Local\JetBrains\Installations\ReSharperPlatformVs16_dc1e6679\TestRunner\net461\ReSharperTestRunner64.exe.config
日志: 使用主机配置文件:
日志: 使用 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config 的计算机配置文件。
日志: 策略后引用: System.Data.SQLite.EF6, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
日志: 尝试下载新的 URL file:///D:/Work2/Project/码云/jrzc/terminal-New/terminal-1.0Tests/bin/System.Data.SQLite.EF6.DLL。
警告: 比较程序集名称时发生不匹配: 生成号
错误: 未能完成程序集的安装(hr = 0x80131040)。探测终止。
# 解决方法
1. 引入 和测试项目一样的版本
<Reference Include="System.Data" /><Reference Include="System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"><HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\lib\net45\System.Data.SQLite.dll</HintPath></Reference><Reference Include="System.Data.SQLite.EF6, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"><HintPath>..\packages\System.Data.SQLite.EF6.1.0.113.0\lib\net45\System.Data.SQLite.EF6.dll</HintPath></Reference><Reference Include="System.Data.SQLite.EF6.Migrations, Version=1.0.102.0, Culture=neutral, processorArchitecture=MSIL"><HintPath>..\packages\SQLite3.EF6.Migrations.1.0.105\lib\System.Data.SQLite.EF6.Migrations.dll</HintPath></Reference><Reference Include="System.Data.SQLite.Linq, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"><HintPath>..\packages\System.Data.SQLite.Linq.1.0.113.0\lib\net45\System.Data.SQLite.Linq.dll</HintPath></Reference>
2.增加`App.config` 文件 ,目标 可以是 X86,X64 ,AnyCPU
<entityFramework><providers><!--1. 在用--><provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /></providers></entityFramework> <system.data><DbProviderFactories> <remove invariant="System.Data.SQLite.EF6" /> <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" /><remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories></system.data><connectionStrings><add name="DefaultConnection" connectionString="data source=db1.db3" providerName="System.Data.SQLite" /></connectionStrings><runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-1.0.113.0" newVersion="1.0.113.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Data.SQLite.EF6" publicKeyToken="db937bc2d44ff139" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-1.0.113.0" newVersion="1.0.113.0" /></dependentAssembly></assemblyBinding></runtime>
SQL ITE 应用单元测试 未能加载文件或程序集相关推荐
- 未能加载文件或程序集“XXX”或它的一个依赖项,试图加载格式不正确的程序...
问题描述: 未能加载文件或程序集"XXX"或它的一个依赖项,试图加载格式不正确的程序 解决方法: 方法一:在vs的配置管理器中,把活动解决方案平台改为Any CPU就可以了 方法二 ...
- 未能加载文件或程序集“*****.dll”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)
未能加载文件或程序集"*****.dll"或它的某一个依赖项.找到的程序集清单定义与程序集引用不匹配.(异常来自HRESULT:0x80131040) 参考文章: (1)未能加载文 ...
- 未能加载文件或程序集“****”或它的某一个依赖项。试图加载格式不正确的程序。解决方案总结
未能加载文件或程序集"****"或它的某一个依赖项.试图加载格式不正确的程序.解决方案总结 参考文章: (1)未能加载文件或程序集"****"或它的某一个依赖项 ...
- 未能加载文件或程序集“Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342...
若本机的Oracle版本是64位系统,则在调用Oracle数据的时间报以下错误: [未能加载文件或程序集"Oracle.DataAccess, Version=2.112.1.0, Cult ...
- mysql core 文件_MySQL未能加载文件或程序集“Ubiety.Dns.Core”或它的某一个依赖项 问题的解决...
在VS2019中使用Nuget的方式添加了最新的MySQL包 MySql.Data 8.0.19 ,默认添加了个Ubiety.Dns.Core,不知道有什么用,但是启动程序后就报错. "/& ...
- 未能加载文件或程序集“SqlServerDal”或它的某一个依赖项。系统找不到指定的文件。...
今天遇到一个挺怪的问题,采用了工厂模式后,出去找不到程序集的问题: 未能加载文件或程序集"Tianyige.SqlServerDAL"或它的某一个依赖项.系统找不到指定的文件. 解 ...
- 错误提示“未能加载文件或程序集“Microsoft.Office.Interop.Owc11”,
.NET错误提示: 未能加载文件或程序集"Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicK ...
- resx文件在X64位编译,提示“未能加载文件或程序集”的问题?
原文:resx文件在X64位编译,提示"未能加载文件或程序集"的问题? resx文件在X64位编译,提示"未能加载文件或程序集"的问题? 解答: 错误现象如下 ...
- ASP.NET中连接Sqlserver数据库时提示:未能加载文件或程序集“Microsoft.SqlServer.Management.Sdk.Sfc
场景 在Visual Studio 2013中连接 SqlServer数据库时提示: 未能加载文件或程序集"Microsoft.SqlServer.Management.Sdk.Sfc 注: ...
- C# WinForm 添加Windows Media Player 控件调试出现未能加载文件或程序集Interop.WMPLib,该怎么解决...
C# WinForm 添加Windows Media Player 控件调试出现未能加载文件或程序集Interop.WMPLib 如标题,在窗体中添加Windows Media Player 控件,当 ...
最新文章
- Excel批量导入数据库
- 避免图像去雾算法中让天空部分出现过增强的一种简易方法
- 人工智能领域论文常见基本概念笔记
- Ajax提交打开新窗口,浏览器拦截处理;以及跨域问题
- mysql 5.6 利用gtid 同步数据遇到的问题记录
- set column oracle,Oracle 用一个表字段更新另一个表字段三种方法
- Partition Array by Odd and Even
- php安装扩展写kafca,安装PHP的kafka扩展
- C# 随机数 Radom 循环生成同一的数字
- 【优化覆盖】基于matlab粒子群算法求解传感器覆盖优化问题【含Matlab源码 1493期】
- Android测试-Monkey Test
- matlab计算可达矩阵,matlab计算可达矩阵
- 开发技巧 | Python极简实现滑动平均滤波(基于Numpy.convolve)
- 计算机如何通过手机连接网络,主编教您手机怎么通过usb连接电脑上网
- 思科警告:旗下某些产品可能存在无法修补的WannaCrypt漏洞
- 光纤交换机 序列号_Brocade 光纤交换机常用命令
- STM32F429 14. TIM_(一)_基本定时器
- android10 禁止下拉状态栏
- math_@多元函数求导@全微分@偏导数@复合偏导
- c语言已知加速度求位移速度,已知初速度,加速度,时间,求位移