.Net 9 RC1 - Cannot set reponse headers when returning IAsyncEnumerable in controller #57895
Closed
1 task done
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Is there an existing issue for this?
Describe the bug
Had similar issues on .NET 6 release, adding just in case it's related:
In .Net 9 RC1 when trying to set a header before yielding the first value on an IAsyncEnumerable, I get the following error:
Implementation of Controller looks like this:
Expected Behavior
The header to be set without errors as is possible in .NET 8
Usecase
We use this mostly to set Pagination headers for paginated lists
Steps To Reproduce
Use this webapi minimal reproduction
https://github.com/gabynevada/.net6-iasync-enumerable-set-header-error
Call endpoint returning IAsyncEnumerable
Can replicate both on RC1 and the daily build for RC2
Exceptions (if any)
.NET Version
9.0.100-rc.2.24466.1
Anything else?
IDE: JetBrains Rider 2024.2.4 on Mac M1 Arm 64
dotnet --info:
The text was updated successfully, but these errors were encountered: