JoshClose / CsvHelper

Library to help reading and writing CSV files
http://joshclose.github.io/CsvHelper/
Other
4.63k stars 1.05k forks source link

New compatibility issue regression due to `System.Linq.Async` inclusion #2228

Closed mrtristan closed 4 months ago

mrtristan commented 5 months ago

Ironically, this compatibility improvement commit caused a regression in compatibility.

https://github.com/JoshClose/CsvHelper/commit/0c59831e69e8bd03a1d6d19246c5fc370aa5d944#diff-6083c99d8c47f7f689694c8c9fd0b00043da05ddc12c010efc96fb1898f0f6fbR53

Adding a dependency on System.Linq.Async causes all sorts of conflicts in EF land and the use of DbSets. Just updating CSVHelper from 30.0.1 to 30.1.0 caused thousands of errors in my projects in unrelated areas due to System.Linq.Async coming in transitively and yielding duplicative extension methods to what's present in EF core.

For history on this, check out the dumpster fire of a thread here: https://github.com/dotnet/efcore/issues/18124

more context here: https://github.com/dotnet/reactive/issues/1057 etc: https://github.com/dsbenghe/Novell.Directory.Ldap.NETStandard/pull/203

JoshClose commented 4 months ago

Looks like I only need to include it in net462, net47, net48 and netstandard2.0. Does this issue occur in these targets also, or is this an issue including the library in a target that already contains it?

JoshClose commented 4 months ago

There was only a single method call that was using that, so I changed it. I can remove the package reference to System.Linq.Async for everything.

JoshClose commented 4 months ago

I have issues with Microsoft.Bcl.AsyncInterfaces now. Might not be as easy as just removing it.

JoshClose commented 4 months ago

Try version 31.0.2.

mrtristan commented 4 months ago

@JoshClose seems good with that version, ty.

fwiw, my class lib that includes the CsvHelper ref targets netstandard2.0;net472;net48;net6.0;net7.0 currently so you're probably good.