我有一个使用DotNetBar 3rd 方 UI 库的大型资源密集型 C# GUI 应用程序。
有时,它会因以下异常和调用堆栈而失败:
====================================
ERROR
====================================
Exception type: ArgumentException
Parameter is not valid.
====================================
CALL STACK
====================================
at System.Drawing.Graphics.get_SmoothingMode()
at DevComponents.DotNetBar.⍜.PaintCaptionBackground(FormCaptionRendererEventArgs e)
at DevComponents.DotNetBar.Rendering.Office2007Renderer.DrawFormCaptionBackground(FormCaptionRendererEventArgs e)
at DevComponents.DotNetBar.OfficeForm.ὀ(Graphics ٠)
at DevComponents.DotNetBar.OfficeForm.ᲀ()
at DevComponents.DotNetBar.OfficeForm.WindowsMessageNCActivate(Message& m)
at DevComponents.DotNetBar.RibbonForm.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在堆栈顶部失败的调用只是访问SmoothingMode属性,而属性 getter 没有参数,因此很难知道“参数无效”可能意味着什么。
这个异常偶尔发生,它不是 100% 的可重现的,但似乎与我的应用程序中的高资源使用率相关(它发生在将特定的大型“项目”加载到应用程序中时),而其他较小的项目不会触发这个,即使大型和小型项目都以相同的方式使用 DotNetBar UI。
什么会导致SmoothingMode
属性抛出 ArgumentException?