ComponentFactory / Krypton

Krypton WinForms components for .NET
BSD 3-Clause "New" or "Revised" License
1.89k stars 692 forks source link

Random KeyNotFoundException when opening a form having Krypton controls #152

Open mbagattini opened 6 years ago

mbagattini commented 6 years ago

From time to time, this kind of exception is raised in our software. I'm not able to track it down to a single cause, it appears randomly in different log files of our customers.

Have anyone noticed it before? Do you have any suggestion about how to avoid it?

Here's the full stack trace:

Stack trace: at System.Collections.Generic.Dictionary``2.get_Item(TKey key) at System.Windows.Forms.ProfessionalColorTable.FromKnownColor(KnownColors color) at System.Windows.Forms.ProfessionalColorTable.get_MenuStripGradientEnd() at ComponentFactory.Krypton.Toolkit.PaletteProfessionalSystem.GetBackColor1(PaletteBackStyle style, PaletteState state) at ComponentFactory.Krypton.Toolkit.PaletteRedirect.GetBackColor1(PaletteBackStyle style, PaletteState state) at ComponentFactory.Krypton.Toolkit.PaletteBackInheritRedirect.GetBackColor1(PaletteState state) at ComponentFactory.Krypton.Toolkit.PaletteBack.GetBackColor1(PaletteState state) at ComponentFactory.Krypton.Toolkit.PaletteBack.GetBackColor1(PaletteState state) at ComponentFactory.Krypton.Toolkit.PaletteBackInheritForced.GetBackColor1(PaletteState state) at ComponentFactory.Krypton.Toolkit.RenderStandard.DrawBack(RenderContext context, Rectangle rect, GraphicsPath path, IPaletteBack palette, VisualOrientation orientation, PaletteState state, IDisposable memento) at ComponentFactory.Krypton.Toolkit.ViewDrawPanel.RenderBefore(RenderContext context) at ComponentFactory.Krypton.Toolkit.ViewComposite.Render(RenderContext context) at ComponentFactory.Krypton.Toolkit.ViewManager.Paint(RenderContext context) at ComponentFactory.Krypton.Toolkit.ViewManager.Paint(IRenderer renderer, PaintEventArgs e) at ComponentFactory.Krypton.Toolkit.VisualPanel.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.OnPrint(PaintEventArgs e) at System.Windows.Forms.Control.WmPrintClient(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

PWagner1 commented 5 years ago

Hi @mbagattini

Is the error occurring with specific usage of controls, if so which controls are they?