Comments (5)
This seems to be an issue with Console.Out and Console.Error when they are pointed to the same destination. It does not appear to be related to DualWriter.
https://github.com/aspnet/AspNetKatana/blob/dev/src/Microsoft.Owin.Hosting/Tracing/TraceOutputFactory.cs#L22
https://stackoverflow.com/a/38746852/2588374
from aspnetkatana.
I know in my case I'm not explicitly setting the output or error streams. I've checked my logging library (NLog), but a quick repository search doesn't show it redirecting the output or error streams (e.g. Console.SetOut
or Console.SetError
), either, outside of its tests. I'll review the other libraries as well, later. It's not impossible, but I'm not really anticipating the Nuget packages I'm using to be hooking themselves into the Console out/err streams. As I understand it the System.Diagnostics.Trace
doesn't directly log to the console, either, except when added as in the line you've mentioned.
I'll see if I can inspect those streams and find more information about them.
from aspnetkatana.
Nice writeup @ZigMeowNyan! I agree that calls to Trace.WriteLine
shouldn't throw exceptions.
This bug caught me today an Owin app with Uncaught Exceptions being handled by us, eventually posting through to NewRelic which just writes to Trace
under the hood without any magic.
I see this is included in Discussions. Is there a timeline to that?
from aspnetkatana.
We have similar deadlock issue from the DualWriter after upgrading nuget packages of OWIN host to v4.0.0.0. It crashes the OWIN host. Any update for this issue? Thank you for your prompt help and support.
Here is the Nuget packages:
Microsoft.AspNet.WebApi.Owin @ v5.2.4
Microsoft.AspNet.WebApi.OwinSelfHost @ v5.2.4
Microsoft.Owin @ v4.0.0.0
Microsoft.Owin.Host.HttpListener @ v4.0.0.0
Microsoft.Owin.Hosting @ v4.0.0
Owin @ v1.0.0
Here is the Exception:
System.ArgumentOutOfRangeException: Count cannot be less than zero.
Parameter name: count
at System.String.CopyTo(Int32 sourceIndex, Char[] destination, Int32 destinationIndex, Int32 count)
at System.IO.StreamWriter.Write(String value)
at System.IO.TextWriter.SyncTextWriter.Write(String value)
at Microsoft.Owin.Hosting.Tracing.DualWriter.Write(String value)
at System.Diagnostics.TextWriterTraceListener.Write(String message)
at System.Diagnostics.TraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id)
at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.TraceMessage(TraceLevel level, String message)
at System.Web.Http.Tracing.SystemDiagnosticsTraceWriter.Trace(HttpRequestMessage request, String category, TraceLevel level, Action1 traceAction) at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action
1 beginTrace, Func1 execute, Action
2 endTrace, Action`1 errorTrace)
at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.HttpServer.d__24.MoveNext()
from aspnetkatana.
Another report of this issue here SignalR/SignalR#4146, which does not appear to be running under the debugger.
from aspnetkatana.
Related Issues (20)
- How to debug OpenIdConnect authentication issues? HOT 12
- Could not load file or assembly Microsoft.Live.Base exception HOT 3
- Unauthorized error 401.0 for Asp.net mvc site with IIS anonymous authentication HOT 8
- /signin-oidc is not found HOT 7
- 'OwinStartupAttribute' is inaccessible due to its protection level HOT 3
- GetExternalLoginInfoAsync() return null for facebook only HOT 6
- Having vulnerabilities on Microsoft.Owin.Security.OpenIdConnect, 4.2.2 HOT 2
- ClockSkew Ignored by OAuthBearerAuthenticationHandler HOT 2
- Requests are run on IOCP threads by default in OwinHttpListener HOT 5
- Attempt to access method System.Management.Instrumentation.InstrumentedAttribute..ctor(System.String) in violation of security transparency rules failed. HOT 2
- Question: Why does the 4.2.2 package specifically require .NET Framework 4.5? HOT 2
- System.NullReferenceException: Object reference not set to an instance of an object HOT 9
- App redirects to different Auth Type refresh token URL. HOT 4
- Strange behavior on port 50000 for Owin self hosting.... HOT 8
- OpenIdConnectProtocolValidator cannot validate state HOT 4
- Should OIDC middleware be refreshing a `code id_token` when close to expiry? HOT 3
- Session in ASP.NET WebForm is cleared after authenticated by Entra ID with CookieAuthentication and WsFederationAuthentication HOT 2
- Always a object reference error when trying to host a webapi in owin self hosted HOT 3
- owin.RequestId always empty guid string HOT 3
- Microsoft.Owin.Security.WsFederation has a vulnerable Newtonsoft.Json package dependency HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetkatana.