nietras / Sep

World's Fastest .NET CSV Parser. Modern, minimal, fast, zero allocation, reading and writing of separated values (`csv`, `tsv` etc.). Cross-platform, trimmable and AOT/NativeAOT compatible.
http://nietras.com
MIT License
840 stars 33 forks source link

Error CS4012 Parameters or locals of type 'SepReader.Row' cannot be declared in async methods or async lambda expressions. #138

Closed josephwinston closed 4 months ago

josephwinston commented 4 months ago

@nietras

I'm sure this is a general dotnet issue but I haven't been able to do a good search on the problem. Maybe you can help me work through this problem.

My main looks like this: static async Task Main(string[] args) since I am calling async methods elsewhere.

When I try to use either:

while (reader.MoveNext())
{
   var row = reader.Current;
}

or

foreach (var row in reader) 
 {
 }

The error occurs at the definition of the row, CS4012 Parameters or locals of type 'SepReader.Row' cannot be declared in async methods or async lambda expressions.

Suggestions are welcome.

nietras commented 4 months ago

See #114 and README

josephwinston commented 4 months ago

THANKS. Closing