I recently installed CsvHelper (https://joshclose.github.io/CsvHelper/) when i try to use the library I get the following error:
Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=126.96.36.199, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
In my app.config I have binding redirect:
<dependentAssembly> <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-188.8.131.52" newVersion="184.108.40.206" /> </dependentAssembly>
Also in my project I have reference to
Its version is 220.127.116.11 I am not sure why its still trying to load 18.104.22.168 of the library.
my project is running .net 4.7.2
So i created a new .net 472 project then added all the libs etc and code and now it works.
I suspect it originally broke because I had installed a really old version of csvhelper lib with excel plugin. Even though i removed it and removed all references it was still picking it up from somewhere.
According to https://github.com/JoshClose/CsvHelper/issues/1462 this seems to be a bug in one of the CSVHelper 15.0.0 dependencies. The 15.0.0 version (not sure about earlier ones) brings in some other assembly which causes the problem.
Personally I worked around this by downgrading to 13.0, but that bug report now states that they have released 15.0.1 specifically to fix this. I've yet to confirm that myself.
User contributions licensed under CC BY-SA 3.0