Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MirrorStreamDecorator: Cannot access a closed Stream #54

Closed
catalingavan opened this issue Dec 26, 2021 · 0 comments
Closed

MirrorStreamDecorator: Cannot access a closed Stream #54

catalingavan opened this issue Dec 26, 2021 · 0 comments
Labels
bug Something isn't working SDK SDK-AspNetCore Related to .NET Core framework

Comments

@catalingavan
Copy link
Owner

In some scenarios, MemoryStreamDecorator is closed by .NET, but we are still trying to access it.

Thus, it throws ObjectDisposedException.

System.ObjectDisposedException: Cannot access a closed Stream.
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at KissLog.MirrorStreamDecorator.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Catalin\KissLog-net\KissLog.Sdk\src\KissLog\MirrorStreamDecorator.cs:line 58
   at KissLog.MirrorStreamDecorator.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\Catalin\KissLog-net\KissLog.Sdk\src\KissLog\MirrorStreamDecorator.cs:line 58
   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.FlushInternalAsync(Boolean flushEncoder)
   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.WriteAsyncAwaited(String value)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.Buffers.ViewBuffer.WriteToAsync(TextWriter writer, HtmlEncoder encoder)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter 
@catalingavan catalingavan added bug Something isn't working SDK-AspNetCore Related to .NET Core framework SDK labels Dec 26, 2021
catalingavan added a commit that referenced this issue Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SDK SDK-AspNetCore Related to .NET Core framework
Projects
None yet
Development

No branches or pull requests

1 participant