CsvHelper does not write WriteRecords

I just added CsvHelper to my project through Nuget. Looking at the CsvHelper wiki page here: https://github.com/JoshClose/CsvHelper/wiki/Basics , he says that CsvHelper provides the WriteRecords method.

Where did he go? I can not find it in the assembly.

Where did WriteRecords Method go?

+4
source share
3 answers

The reason this happened is more than likely NuGet chose the wrong version of CsvHelper. Like other commentators, your project probably has a .NET 2.0 CsvHelper assembly, although your project is a 4.5 project.

An error has appeared in NuGet (it seems to be returning), where it will select the full version of the .NET library instead of the client profile version, even if the client profile version is a higher version or the corresponding version in your case.

In CsvHelper, the .NET 2.0 assembly is the full version because there is no client profile. All other versions are client profile assemblies.

The solution is to update NuGet and hope that they are fixed. If NuGet chooses the wrong one, you can manually delete the link and select the correct option in the correct NuGet package folder.

Many people reported this problem, unfortunately, I can not do anything to change it; As far as I understand. I filed a bug with NuGet and it was fixed, but some people report that this happens in later versions of NuGet; although I have not experienced this myself.

This is a fixed NuGet bug. http://nuget.codeplex.com/workitem/2502

+4
source

Check the target .NET runtime. ICSVWriter exposes WriteRecords , but only if it is not intended for .NET 2.0

0
source

If you look at the source of CsvWriter , you will see that the WriteRecords method WriteRecords . What version of CsvHelper did you install?

0
source

All Articles