WindowsBase.dll中的WPF目标调用异常

时间:2016-03-23 11:53:22

标签: wpf targetinvocationexception

我正在研究WPF的问题,偶尔会发生在客户端。不幸的是,客户端不愿意提供他的数据库的备份或连接字符串,我不允许安装任何外部应用程序进行诊断。因此,我手中唯一的事就是尝试重现它。但是,我试图在这个论坛上与专家并行寻求解决方案。

初看起来,似乎问题可能是由于Scroll Viewer控件,因为我可以看到堆栈跟踪:

at System.Windows.Controls.ScrollContentPresenter.ValidateInputOffset    (Double offset, String parameterName) at System.Windows.Controls.ScrollViewer.

然而,在高端,我得到一个未处理的例外:

System.Reflection.TargetInvocationException occurred in WindowsBase.dll 

在我的申请表中。

查看错误的更多细节,我发现异常消息为:

Exception has been thrown by the target of an invocation.

内部异常显示消息:

offset parameter value cannot be Nan.Parameter name: offset. Inner Exception Source is Presentation Framework.

以下是来自客户端的详细堆栈跟踪:

    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]     arguments, Signature sig, Boolean constructor)  
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,     Object[] parameters, Object[] arguments)  
    at System.Delegate.DynamicInvokeImpl(Object[] args)  
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate    callback, Object args, Int32 numArgs)  
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source,Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)  
    at System.Windows.Threading.DispatcherOperation.InvokeImpl()  
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)  
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.ProcessQueue()
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)  
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)  
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)  
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)  
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)  
    at System.Windows.Application.RunDispatcher(Object ignore)  
    at System.Windows.Application.RunInternal(Window window)  
    at System.Windows.Application.Run(Window window)  
    at AvocetVM.App.Main()

有没有人遇到过这类问题或有人知道解决方案吗?

0 个答案:

没有答案