I have a large and resource intensive C# GUI application which uses the DotNetBar 3rd party UI library.
Occasionally, it fails with the following exception and call stack:
====================================
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)
The call which is failing at the top of the stack is just accessing the SmoothingMode property, and property getters have no parameters, so it's a bit hard to know that the "Parameter is not valid" could mean.
This exception happens sporadically, it's not reproducible 100% of the time, but does seem to be associated with high resource usage within my application (it happens on loading a particular large "project" into the application) whereas other smaller projects do not trigger this, even though both large and small projects use the DotNetBar UI in the same way.
What would cause the SmoothingMode
property to throw an ArgumentException?