exceldatareader - ExcelDataReader 3.4 - System.IO.FileLoadException
问题描述
我正在使用 ExcelDataReader 3.4,它在我的开发人员 PC 上运行良好,但在生产 PC 上使用时,出现此错误
System.IO.FileLoadException:无法加载文件或程序集“System.IO.Compression,Version=4.2.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)
在我的项目中,我System.IO.Compression
复制了本地。
我正在使用 .NET 4.5、Visual Studio 2017
解决方案
我发现了这个问题。在我的 WPF 应用程序的 App.Config 中有那些行
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
</dependentAssembly>
</assemblyBinding>
我更改了 4.0.0.0 的版本,现在它可以工作了。
推荐阅读
- php - PHP str_replace 删除文件内容
- javascript - 如何使用来自独立 node.js 应用程序的 ethers.js 连接到 Metamask 钱包?
- reactjs - 如何访问选定对象的值
- javascript - JSDoc:使用来自不同模块的 ES6 类和 @type 标签
- python - 将文本文件行的第一节和最后一节排序到字典中
- c# - 当 iPhone 用户退出主屏幕或 App Switcher 时,如何让我的计时器继续运行?
- python - 如何根据另一个数据框列值对数据框进行排序?
- vb.net - vb.net 什么是 %Delay% 和其他
- python - 是否可以仅使用 Python 计算图像中的白色像素?
- python - 如何使用集成模型从堆叠中获取每个基本模型的分数