仍然没有解决这个问题,但我确信它确实在我自己的自定义身份验证机制中-所以我接受Henk的答案。
<system.diagnostics>
<sources>
<source name="System.IdentityModel" switchValue="All">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="IdentityModelListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\Tracing\App_identitymodellog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="IdentityModelListener" traceOutputOptions="Timestamp, Callstack">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
从这些痕迹中可以看出:
System.Diagnostics.TraceEventCache.get\u Callstack()
System.Diagnostics.XmlWriterTraceListener.WriteFooter(跟踪事件缓存
事件缓存)
System.Diagnostics.TraceSource.TraceData(TraceEventType)
System.ServiceModel.Diagnostics.DiagnosticTrace.TraceEvent(TraceEventType)
描述,TraceRecord trace,
异常,对象源)
类型,跟踪代码,字符串
System.IdentityModel.SecurityUtils.CreateDefaultAuthorizationContext(IList)`1
System.ServiceModel.ServiceSecurityContext.get\u AuthorizationContext()
操作上下文)在。。。
操作上下文、消息和;消息)在
>System.ServiceModel.Dispatcher.AuthorizationBehavior.Authorize(MessageRpc&
rpc)
System.ServiceModel.Dispatcher.MessageRpc.Process(布尔值
等操作上下文集)
System.ServiceModel.Dispatcher.ChannelHandler.DispatchedReleasePump(请求上下文
请求,布尔线程,
当前操作上下文)
System.ServiceModel.Dispatcher.ChannelHandler.HandlerRequest(请求上下文
请求,操作上下文
System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult)
System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()
securityContext、ContextCallback
System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()
System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()
System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(对象
(州)
System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.scheduledverlapped.IOCallback(UInt32)
错误代码,UInt32个字节,
本机重叠*本机重叠)
System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32)未处理异常
错误,UInt32 bytesRead,
本机重叠*本机重叠)
System.Threading.\u IOCompletionCallback.PerformIOCompletionCallback(UInt32)
错误代码,UInt32个字节,
本地重叠*pOVERLAP)
Dispatcher.AuthorizationBehavior.Authorize()之后的下一个调用是我自己的AuthorizationManager实现。这很可能就是问题的根源。Authorize()方法仅抛出FaultException作为结果。