Hi, I am trying to use the TextFieldParser class to parse some CSV files in my project.
I am using Unity 2019.3.9f1. Under Edit > Project Settings > Player > Other Settings, I have API Compatibility Level set to .NET 4.x. (Supposedly, this should provide my project access to .NET 4 API, which contains Microsoft.VisualBasic.FileIO.) In the C# script I am attempting to use TextFieldParser in, I have “using Microsoft.VisualBasic.FileIO;”. When I open my Unity project, I receive the following error message in the Unity console: “error CS0234: The type or namespace name ‘FileIO’ does not exist in the namespace ‘Microsoft.VisualBasic’ (are you missing an assembly reference?)”.
The platform I have specified in Build Settings is iOS if that is relevant information also.
I have tried adding an assembly reference through Visual Studio (Community 2019). I open up the .csproj file overseeing the .cs file that I am trying to add TextFieldParser to, right-click it to add a reference, and browse to the Microsoft.VisualBasic.dll file found in my Unity installation’s folder (C:\Program Files\Unity\Hub\Editor\2019.3.9f1\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Microsoft.VisualBasic.dll). This reference gets added (and I am able to create a TextFieldParser object without incident), but upon re-launching my Unity project, it gets removed! And I am left with the same error message in the Unity console.
I would appreciate any help to resolve this mystery.