ExcelDataReader 3.4 - System.IO.FileLoadException

0

I'm using ExcelDataReader 3.4 and it work fine on my developer PC, but when used on production PC, I've got this error

System.IO.FileLoadException: Could not load file or assembly 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT : 0x80131040)

In my project I have System.IO.Compression copied local.
I'm using .NET 4.5, Visual Studio 2017

exceldatareader
fileloadexception
system.io.compression
asked on Stack Overflow Jun 18, 2018 by Raphael • edited Oct 20, 2018 by shA.t

1 Answer

1

I found the issue. In the App.Config of my WPF application there was those line

<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>

I changed the version for 4.0.0.0 and now its working.

answered on Stack Overflow Jun 18, 2018 by Raphael

User contributions licensed under CC BY-SA 3.0