FileStreamResultExecutor does not support DisposeAsync #55441
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
help wanted
Up for grabs. We would accept a PR to help resolve this issue
Milestone
Is there an existing issue for this?
Describe the bug
FileStreamResultExecutor.ExecuteAsync should use
await using (result.FileStream)
instead ofusing (result.FileStream)
.aspnetcore/src/Mvc/Mvc.Core/src/Infrastructure/FileStreamResultExecutor.cs
Line 31 in 923b62f
aspnetcore/src/Shared/ResultsHelpers/FileResultHelper.cs
Line 33 in be9a344
Expected Behavior
Streams that require DisposeAsync (that throw for usage of sync Dispose) can be used with FileStreamResult.
Steps To Reproduce
Exceptions (if any)
.NET Version
8.0.101
Anything else?
No response
The text was updated successfully, but these errors were encountered: