DotNetAnalyzers / IDisposableAnalyzers

Roslyn analyzers for IDisposable
MIT License
383 stars 26 forks source link

IDISP001 False Positive with MemoryStream and File Return #535

Open ondrejholik opened 1 year ago

ondrejholik commented 1 year ago
var imageStream = new MemoryStream();
return File(imageStream, "image/png");

Should not trigger IDISP001

https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase.file?view=aspnetcore-7.0&viewFallbackFrom=net-7.0