jsnlog
jsnlog copied to clipboard
Injection fails for Static Files in .NET 7
Thanks for this excellent tool. I turned off the injection because it was causing problems in the pipeline:
System.NullReferenceException: Object reference not set to an instance of an object.
at JSNLog.Infrastructure.ResponseStreamWrapper.FlushAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.StreamResponseBodyFeature.SendFileAsync(String path, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, IFileInfo file, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.SendAsync()
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.ServeStaticFile(HttpContext context, RequestDelegate next)
at Cas.SpecCom.Shared.Web.Core.Infrastructure.Middleware.Redirect404EndpointRequestsToFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Kestrel was handling the failure ultimately -- but all the errors were:
System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (0 of 25793).