我从 Facebook 获取数据,每 2 次运行一次,我得到一个目标调用异常,我不知道为什么有时它会起作用,有时却不起作用。我曾尝试使用 FacebookOAuthException,但它不起作用。有任何想法吗?这是我的堆栈跟踪:
System.Reflection.TargetInvocationException was unhandled
HResult=-2146232828
Message=An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
Source=System
StackTrace:
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at Facebook.OpenReadCompletedEventArgs.get_Result()
at Facebook.Client.FacebookSessionClient.<SendAnalytics>b__0(Object o, OpenReadCompletedEventArgs e)
at Facebook.HttpHelper.OnOpenReadCompleted(OpenReadCompletedEventArgs args)
at Facebook.HttpHelper.ResponseCallback(IAsyncResult asyncResult, Object userToken)
at Facebook.HttpHelper.<>c__DisplayClass2.<OpenReadAsync>b__0(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.HttpWebRequest.SetResponse(Exception E)
at System.Net.HttpWebRequest.SetAndOrProcessResponse(Object responseOrException)
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult returnResult)
at System.Net.Connection.CompleteConnectionWrapper(Object request, Object state)
at System.Net.PooledStream.ConnectionCallback(Object owningObject, Exception e, Socket socket, IPAddress address)
at System.Net.ServicePoint.ConnectSocketCallback(IAsyncResult asyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.Socket.ConnectCallback()
at System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean timedOut)
at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)
InnerException: Facebook.WebExceptionWrapper
HResult=-2146233088
Message=Unable to connect to the remote server
InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond 31.13.81.33:443
Source=System
ErrorCode=10060
NativeErrorCode=10060
StackTrace:
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
InnerException: