double Average(int[] arr)
{
double result = 0;
for(int i = 0; i < arr.Length; i++) //arr.Length <-- this is field access
{
result = result + arr[i];
};
result = result / arr.Length;
return result;
}
And then I try with cecil get the Length_get method from the mscorelib the Cecil reference to the System.Private.CoreLib. If I target .net framework then everything is fine.
I have read on github issues with problems with .net core but I didn't find the solution.
I can give small repro if need.
(I think this is related https://github.com/jbevain/cecil/issues/487)
How I can resolve this. Or for my project better use the System.Reflection namespace.
Thanks.