我的應用在一個設備上的某些時段崩潰,出現以下錯誤:無效的URI:指定了無效的端口。無法捕捉當前的堆棧跟蹤domain_UnhandledException System.UriFormatException
問題是,我找不到具體的方法導致此。而且它只在一些德國網絡區域的一臺設備上崩潰。堆棧跟蹤只顯示以下信息:
Current domain_UnhandledException. Stack trace: System.UriFormatException: Invalid URI: Invalid port specified.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at HttpServer.HttpClientContext.OnRequestLine(Object sender, RequestLineEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at HttpServer.Parser.HttpRequestParser.OnFirstLine(String value)
at HttpServer.Parser.HttpRequestParser.Parse(Byte[] buffer, Int32 offset, Int32 count)
at HttpServer.HttpClientContext.OnReceive(IAsyncResult ar)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
我可以得到一些想法,我怎麼能找到失事源?
我們需要看到你的源代碼,而實際的端口號(錯誤消息的主題),是造成這個問題。 –
崩潰在'HttpServer.HttpClientContext.OnRequestLine'中,它試圖創建一個無效的URI。現在,我們在這裏討論的是哪個'HttpServer'?它不能是'System.Web.Http'中的'HttpServer',因爲它不包含'HttpClientContext'屬性。你的代碼在哪個平臺上運行,它是什麼類型的應用程序? –
源代碼不會幫助,因爲它是一個巨大的應用程序 - 這是一個wpf播放器的服務。 應用程序是x86,並在Windows 7上運行。 我認爲問題出在Assembly HttpServer.dll,v1.0.0.0 –