I am using CsvHelper 4.0.3 .
I have a nested class defined as follows:
private class CsvLine {
public string Solution;
public string Project;
public string DependsOnProject;
public string Weight;
public string DependsOnPackage;
public string PackageVersion;
}
My .csv file that I want to parse with CsvHelper
has the following field names:
Solution,Project,DependsOnProject,Weight,DependsOnPackage,PackageVersion
Here is my code:
TextReader readFile = new StreamReader(dependenciesCsvFilePath);
var csvReader = new CsvReader(readFile);
IEnumerable<CsvLine> records = csvReader.GetRecords<CsvLine>();
As per the documentation here , the code above should work.
However, when I check records
, I see a message No members are mapped for type 'ParentClass+CsvLine'
.
I changed the availability CsvLine
from private
to public
, but that didn't matter.
What have I done wrong?
EDIT: I tried to expose the class CsvLine
and make it publicly available, but that didn't help either.
EDIT: Nkosi; , records
- : " ". CSV , .
:
Solution,Project,DependsOnProject,Weight,DependsOnPackage,PackageVersion
FOD.sln,ABC.DEF,IMS.ABC,1,,
FOD.sln,ABC.DEF,IMS.DEF,1,,
FOD.sln,ABC.DEF,IMS.GHI,1,,
FOD.sln,ABC.DEF,IMS.JKL,1,,
EDIT: ! Nkosi Panagiotis .