abp icon indicating copy to clipboard operation
abp copied to clipboard

System.ObjectDisposedException from Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync

Open ejohnson-dotnet opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

I have a solution using the Abp framework version 8.3.1 and another package tusdotnet from

https://github.com/tusdotnet/tusdotnet.

In the MyAppWebServerModule.cs file of the .Web project, if I include this line of code in the OnApplicationInitialization:

app.UseAbpStudioLink();

I am getting an exception of System.ObjectDisposedException: Cannot access a closed Stream. after uploading a file to a TUS endpoint. This exception happens even though the TUS file upload was successful and it completed.

If I comment out that line, I do not get the exception.

Here is the full exception from the log file:

2024-10-16 15:20:07.390 -05:00 [ERR] An unhandled exception has occurred while executing the request.
System.ObjectDisposedException: Cannot access a closed Stream.
   at System.IO.Strategies.BufferedFileStreamStrategy.CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
   at System.IO.AbpStreamExtensions.CreateMemoryStreamAsync(Stream stream, CancellationToken cancellationToken)
   at System.IO.AbpStreamExtensions.GetAllBytesAsync(Stream stream, CancellationToken cancellationToken)
   at Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

8.3.1

User Interface

MVC

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

ejohnson-dotnet avatar Oct 17 '24 21:10 ejohnson-dotnet