diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs index 26dd0b0999..50d65ce02d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs @@ -1,5 +1,4 @@ using System; -using System.Buffers; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Net.Http.Headers; @@ -34,9 +33,9 @@ namespace Volo.Abp.AspNetCore.Mvc.ContentFormatters context.HttpContext.Response.Headers[HeaderNames.ContentDisposition] = contentDisposition.ToString(); } - using (var stream = remoteStream.GetStream()) - { - await stream.CopyToAsync(context.HttpContext.Response.Body); + using (remoteStream) + { + await remoteStream.GetStream().CopyToAsync(context.HttpContext.Response.Body); } } }