-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when serializing IAsyncEnumerable in .NET 6 #155
Comments
Honestly I'm surprised that IAsyncEnumerable works at all. |
Oh, why is that? A clarification, this was actually the return type of an action in ASP.NET Core. It used to serialize it as a regular |
IAsnycEnumerable only works properly if you have a full async pipeline. I guess that in 5.0 it was actually sync or fully synchronously buffered and in 6.0 it's not anymore. |
Okay, I see then. I converted it to a |
It would be quite useful if you could provide a repro for your problem, this problem is likely dependent on one of the concrete types. |
Just create an ASP.NET Core project with a controller containing an action with the return type |
Okay, you still return IAsnycEnumerable, I was confused as you wrote about Ienumerable in between. |
I've had a piece of code that serializes an
IAsyncEnumerable
since this type was introduced in .NET Core 3.1 and it's been working great together with SpanJson.Recently, I upgraded to the newly released .NET 6 and after testing my application I got a long stack of errors at the location that serializes this type.
Would you mind checking what's causing the issue?
(The chain of errors is much longer than this but looks very similar to above)
The text was updated successfully, but these errors were encountered: