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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20964360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 10:26:20  来源:igfitidea点击:

Not enough quota is available to process this command -WPF

c#wpfmvvm-light

提问by Ranish

I am working on a WPF application. I have implemented error handling and implemented error mail sending feature for this application. So admin will get the error message if any error happened in the application. My issue is we are always getting a following error message.

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

Error : Not enough quota is available to process this command

MS.Win32.UnsafeNativeMethods.PostMessage(HandleRef hwnd, WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet) at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam) at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

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

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.UpdateWindowPos( IntPtr lParam) at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, at Boolean& 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(Object o) args, Int32 numArgs) 在 MS.Internal.Threading.ExceptionFilterHelper。TryCatchWhen(对象源,委托方法,对象参数,Int32 numArgs,委托catchHandler)

We have used MVVM light toolkit messengers, tasketc for this application. Also I have a data grid in the application.

我们为此应用程序使用了MVVM 轻型工具包信使、任务等。此外,我在应用程序中有一个数据网格。

How we trace this error? Anyone knows the reason of this “Not enough quota is available error”? Any help would be appreciable. Thanks in Advance.

我们如何追踪这个错误?任何人都知道这个“没有足够的配额可用错误”的原因?任何帮助将是可观的。提前致谢。

回答by Marc Roussel

The reason and the action is here : https://msdn.microsoft.com/en-us/library/ms820778.aspx

原因和操作在这里:https: //msdn.microsoft.com/en-us/library/ms820778.aspx

Another link to help you out : http://blog.coultard.com/2012/01/fix-windows-error-0x80070718-not-enough.html

另一个可以帮助您的链接:http: //blog.coultard.com/2012/01/fix-windows-error-0x80070718-not-enough.html

In short increasing the Page File size should be enough to get rid of the error I had the same error a while ago and after increasing the Page File size it went away !

简而言之,增加页面文件大小应该足以消除错误我不久前遇到了同样的错误,在增加页面文件大小后它消失了!

回答by Jérémie Leclercq

Another potential source of the problem : https://github.com/dotnet/roslyn/issues/9247

问题的另一个潜在来源:https: //github.com/dotnet/roslyn/issues/9247

None. WPF is hooking the AppDomain exit logic. Unhandled exceptions from this call back result in process failure. There is no way for us to hook this call.

I've actually brought this up to the CLR team because it's one of many cases where we keep getting bitten by unhandled exceptions from AppDomain exit.

没有任何。WPF 正在挂钩 AppDomain 退出逻辑。此回调中未处理的异常会导致进程失败。我们没有办法挂断这个电话。

我实际上已经将这个问题提交给了 CLR 团队,因为这是我们不断被 AppDomain 退出时未处理的异常所困扰的众多案例之一。

In short : Process exit is called directly in the form (For example with Environnement.Exit) without cleaning up the DispatcherUnhandledException.

简而言之:在不清除 DispatcherUnhandledException 的情况下,直接在表单中调用进程退出(例如使用 Environnement.Exit)。