CsvHelper Package Works Well on Android and UWP But Not on iOS

I have a Xamarin solution created by Visual Studio 2017 RC. It supports Android, UWP, and iOS. I added a PCL project to the solution for code sharing. The PCL project refers to a NuGet pacakge - CsvHelper version 2.16.3.0. In a CS file, I made a call to CsvReader's GetRecords method. The call works well on Android and UWP. However, it throws an exception on iOS (simulator). The whole project can be download here:
https://github.com/MrMYHuang/tfwc
The problematic file is tfwc/tfwc.Portable/tfwcTabPage.xaml.cs and the line
var fcFullListOrig = csvr.GetRecords().ToList();

I used Debug.WriteLine to get the stacktrace:
{System.NotImplementedException: The method or operation is not implemented.
at Microsoft.Scripting.Interpreter.LightCompiler.CompileMemberInitExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1532
at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x002a7] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1660
at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop (System.Linq.Expressions.LambdaExpression node) [0x00055] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:221
at Microsoft.Scripting.Generation.CompilerHelpers.LightCompile (System.Linq.Expressions.LambdaExpression lambda) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Generation/CompilerHelpers.cs:619
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/System.Core/System.Linq.Expressions.Interpret/LambdaCompiler.cs:41
at System.Linq.Expressions.LambdaExpression.Compile () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs:127
at CsvHelper.CsvReader.CreateFuncForObject (System.Type recordType) [0x000a6] in :0
at CsvHelper.CsvReader.CreateReadRecordFunc (System.Type recordType) [0x00053] in :0
at CsvHelper.CsvReader.GetReadRecordFunc[T] () [0x0000b] in :0
at CsvHelper.CsvReader.CreateRecord[T] () [0x00000] in :0
at CsvHelper.CsvReader+d__65`1[T].MoveNext () [0x0002b] in :0 }

It seems to be a problem of Xamarin.iOS?

Sign In or Register to comment.