3

我在 WCF 服务器中添加了 IErrorHandler 实现。
当调试器点击此方法时:

public void ProvideFault(Exception error, MessageVersion version, ref Message fault)

看来我失去了所有的堆栈跟踪。
我想查看 System.Diagnostics.Stacktrace 中的堆栈跟踪(快速查看),并了解哪个 WCF 方法是当前错误/异常处理的入口点。

取而代之的是,我得到了这个堆栈:

WebApi.DLL!WebApi.ErrorHandler.ProvideFault(System.Exception 错误,System.ServiceModel.Channels.MessageVersion 版本,参考 System.ServiceModel.Channels.Message 故障)第 29 行 C# System.ServiceModel.dll!System.ServiceModel.Dispatcher.ErrorBehavior .ProvideFault(System.Exception e, System.ServiceModel.Channels.FaultConverter faultConverter, ref System.ServiceModel.Dispatcher.ErrorHandlerFaultInfo faultInfo) + 0x8e 字节
System.ServiceModel.dll!System.ServiceModel.Dispatcher.ErrorBehavior.ProvideMessageFaultCore(ref System.ServiceModel .Dispatcher.MessageRpc rpc) + 0x118 字节
System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0xab 字节 System.ServiceModel.dll!System.ServiceModel.Dispatcher.MessageRpc.ProcessError(System.Exception e) + 0x3c3 字节
System.ServiceModel.dll!System.ServiceModel.Dispatcher.MessageRpc.Process(bool isOperationContextSet) + 0x21e 字节 System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(System.ServiceModel.Channels.RequestContext request, bool cleanThread, System.ServiceModel.OperationContext currentOperationContext) + 0x664 字节 System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(System.ServiceModel.Channels.RequestContext request, System.ServiceModel.OperationContext currentOperationContext) + 0x1e3 字节
System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(System.IAsyncResult 结果) + 0x4b 字节 System.Runtime.DurableInstancing.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult 结果) + 0x32 字节
System.Runtime.DurableInstancing.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously) + 0x16b 字节 System.Runtime.DurableInstancing.dll!System.Runtime.InputQueue.AsyncQueueReader.Set(System.Runtime.InputQueue.Item 项) + 0x41 字节 System.Runtime.DurableInstancing.dll!System.Runtime.InputQueue.EnqueueAndDispatch(System.Runtime.InputQueue.Item 项,布尔 canDispatchOnThisThread) + 0x3d7 字节
System.Runtime.DurableInstancing.dll!System.Runtime.InputQueue.EnqueueAndDispatch(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x7e 字节 System.ServiceModel.dll!System.ServiceModel.Channels.SingletonChannelAcceptor。 Enqueue(System.ServiceModel.Channels.RequestContext 项, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x66 字节
System.ServiceModel.dll!System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(System.ServiceModel.Channels.HttpRequestContext 上下文, System.Action回调) + 0x22e 字节 System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(System.ServiceModel.Activation.HostedHttpRequestAsyncResult 结果) + 0x12d 字节
System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() + 0x24e 字节
System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() + 0x55 字节
System.ServiceModel.Activation。 dll!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(object state) + 0x53 bytes
System.Runtime.DurableInstancing.dll!System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* nativeOverlapped) + 0x71 字节
System.Runtime.DurableInstancing.dll!System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(uint error, uint bytesRead, System.Threading.NativeOverlapped* nativeOverlapped) + 0x40 字节
mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) + 0x96 字节
[本地到托管转换]
[Appdomain 转换]
[本地到托管转换]

4

0 回答 0