没有足够的配额来处理此命令-WPF

问题描述 投票:12回答:2

我正在处理WPF应用程序。我已经为此应用程序实现了错误处理并实现了错误邮件发送功能。因此,如果应用程序发生任何错误,管理员将收到错误消息。我的问题是我们总是收到以下错误消息。

错误:没有足够的配额来处理此命令

MS.Win32.UnsafeNativeMethods.PostMessage(HandleRef hwnd,WindowMessage msg,IntPtr wparam,IntPtr lparam)在System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget,Nullable`1 channelSet)在System.Windows.Interop.HwndTarget。 System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg,IntPtr wparam,IntPtr lparam)处的UpdateWindowPos(IntPtr lParam)(System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd,Int32 msg,IntPtr LParam,IntPtr lParam,IntPtr lParam) )在MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)在MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32消息,IntPtr wParam,IntPtr lParam,布尔值和已处理)(Object o)在System.Windows.Thread。 ,对象args,Int32 numArgs),位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源,委托方法,对象args,Int32 numArgs,委托catchHandler)

我们已使用MVVM轻型工具包Messenger,任务等用于该应用程序。我的应用程序中也有一个数据网格。

我们如何跟踪此错误?有人知道“没有足够的配额可用错误”的原因吗?任何帮助将是可观的。在此先感谢。

c# wpf mvvm-light
2个回答
0
投票

无。 WPF正在挂钩AppDomain退出逻辑。此回调未处理的异常导致过程失败。我们无法挂断此电话。

我实际上已经将其提交给CLR团队,因为它是众多我们不断被未处理的异常咬伤的情况AppDomain出口。

简而言之:直接以表单的形式(例如,使用Environnement.Exit)调用进程出口,而无需清理DispatcherUnhandledException。

© www.soinside.com 2019 - 2024. All rights reserved.