Skip to content

System.InvalidOperationException: Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead. #232

@AnthonyMastrean

Description

@AnthonyMastrean

The EndOfStream call in the CSV input formatter is synchronous and causes the model binder to throw an exception due to this breaking change.

System.InvalidOperationException: Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.

That loop condition can be changed to something like this:

string line;
while ((line = await reader.ReadLineAsync()) != null)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions