Just going through our application exception logs, and by far the most common error we are seeing is the ribbon throwing exceptions. The two most common are ArgumentException (Parameter is not valid), and OutOfMemoryException. We have about 100 users using the application over citrix, and we're seeing these errors multiple times daily. Visually the result is that the ribbon isn't drawn, instead showing a white rectangle with a black border and red cross through it.
Our application is a WinForms application, currently using Infrafistics 2018.2. Its an MDI application using a master Ribbon on the MDI parent, with additional ribbons being merged from child forms.Merging takes the form of both new tabs, and new groups within existing tabs.
Here are some sample exceptions and stack traces:
ArgumentException
These always end up in GetHdc
at System.Drawing.Graphics.GetHdc() at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags) at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges) at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight) at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureParts(String text, Int32[] parts, Font font, Single& lineHeight) at Infragistics.Win.FormattedLinkLabel.NodeText.TextLayoutInfo.Measure(PositionElementsInfo& info) at Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info) at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info) at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info) at Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info) at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionElements(IFormattedLinkLabelOwner owner, UIElement containerElem, Rectangle containerRect, Boolean calcIdealLayoutSize, Size& layoutSize) at Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionElementsHelper(Rectangle layoutRect, Boolean setElemRectToIdealSize) at Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
OutOfMemoryException
at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr) at Infragistics.Win.DrawUtility.DrawImage(Graphics g, Image image, Rectangle destRect, Rectangle srcRect, Int16 alphaLevel, ImageAttributes imgAttributes, Boolean tile, ColorRenderMode colorRenderMode, ImageBackgroundStretchMargins margins) at Infragistics.Win.DrawUtility.DrawImage(Graphics g, Image image, Int16 alphaLevel, Rectangle destRect, Rectangle srcRect, Rectangle invalidRect, ImageAttributes imgAttributes, Boolean tile, ColorRenderMode colorRenderMode) at Infragistics.Win.DrawUtility.DrawImage(Graphics g, Image image, AppearanceData& appearanceData, AlphaBlendMode alphaMode, Boolean scaled, Rectangle renderRect, Rectangle invalidRect, ImageAttributes imgAttributes, Boolean maintainAspectRatio, Boolean drawBorderShadow, Color shadowColor, Byte startAlpha, Byte endAlpha, Byte shadowDepth, ColorRenderMode colorRenderMode) at Infragistics.Win.ImageUIElementBase.DrawImage(UIElementDrawParams& drawParams) at Infragistics.Win.ImageAndTextUIElement.ImageAndTextDependentImageUIElement.DrawImage(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UltraWinToolbars.RibbonGroupUIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics, Nullable`1 zoomFactor) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Hello Kevin,
Thank you for your update on this matter. From it, I have a couple of recommendations and requests for you, but I do not have a solution, as I fully believe that an isolated sample project that demonstrates these issues will be necessary in order to really take further action on them – assuming the issues still exist in more recent versions.
My first recommendation is to update the version of Infragistics for Windows Forms that you are using. You have mentioned that you are using version 18.2.20182.130. This is the base version of 2018.2 and there have been 4 service releases for this version since. The current version of 18.2 is 18.2.20182.429, which is also the last version of 2018.2, as the development period for 18.2 has since passed. I would recommend upgrading to version 18.2.20182.429 and testing against it to see if these issues still exist there. You can do this through your My Keys and Downloads page and selecting the 2018.2 product you are registered to. This will result in a new set of tabs, where one reads “Service Releases.” You can download the installer for version 18.2.20182.429 there.
Regarding the ArgumentException, it will be very useful to know exactly the action that your users have taken and what is happening in your application as a result of those actions that causes the exception in this case. Again, I believe an isolated sample project will be necessary here.
Regarding the OutOfMemoryException, were you able to run your application through a memory profiler to get more information on what may be leaking memory?
Regarding the environment, I think the most useful thing here would be to know if at runtime, the same issues your users are seeing happen in a supported environment – that is, a Windows environment and not a Citrix-displayed one as Citrix is not a supported environment. This would tell us that this issue is not necessarily Citrix-specific.
Please let me know if you have any other questions or concerns on this matter.
Hi Andrew,
A sample application would be difficult to provide. The application where we are seeing these errors is a large ERP like system, with a lot of external dependencies needed to run. There are a few exceptions that share the same behaviour to the user, ie, the red cross across where the toolbar should be. Our application doesn't use the FormattedLinkLabel control at all, so my assumption was that the ribbon is using it internally
I realised when I posted it that this would be difficult to do anything about it due to issues with reproducing it, etc, I brought it up mostly in case the strack traces shed any light. I had seen very similar issues reported in the past (eg this one )
Here's another example of an exception, for what its worth. This one is less frequent than the argument exception, but more frequent than the memory one. Same result (red cross over ribbon):
============= ExternalException - A generic error occurred in GDI+. ============= at System.Drawing.Image.SelectActiveFrame(FrameDimension dimension, Int32 frameIndex) at System.Drawing.ImageAnimator.ImageInfo.UpdateFrame() at System.Drawing.ImageAnimator.UpdateFrames(Image image) at Infragistics.Win.ImageUIElementBase.DrawImage(UIElementDrawParams& drawParams) at Infragistics.Win.ImageAndTextUIElement.ImageAndTextDependentImageUIElement.DrawImage(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UltraWinToolbars.RibbonGroupUIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams) at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams) at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics, Nullable`1 zoomFactor) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
My team and I have done an initial review of this post and I believe we will require a sample application or at least some more information on what operations are happening within the application when these exceptions are happening. With the above said, it appears that the ArgumentException in this case is happening within the UltraFormattedLinkLabel object, and not necessarily the Ribbon of the UltraToolbarsManager, specifically.
Further regarding these issues, can you please provide some detailed information on the following?
1. What is the specific version of Infragistics for Windows Forms 2018.2 that you are using? This number can be found on the properties of the DLL, and will look like 18.2.20182.XXXX.
2. What action is happening that results in the ArgumentException?
3. Does the Out of Memory Exception happen on startup, or after the application has been running for awhile? In the case of the latter, have you tried profiling the application to see why the memory usage is so high? What was the result of this profiling session?
4. Do these exceptions happen in a non-Citrix environment? I ask, as Citrix is not one of our supported environments as per our supported environments page, here.