我使用的是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,VisualStudio2017
发布于 2018-06-18 18:23:52
我发现了问题。在我的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,现在开始工作了。
https://stackoverflow.com/questions/50911924
复制相似问题