System.ArgumentException (PixelFormat) throwing randomly after moving to Windows 10


We're working on a desktop winforms app that makes use of webbrowser control (if that changes anything). After moving from windows 7 to windows 10, it started throwing exceptions like the one below. The problem is, these exceptions are occurring randomly (or we cannot find any pattern). Exception can occur after 5 minutes or 3 hours of app usage. Hence, asking for help. Any suggestion would be very much appreciated.

Log Name:      Application
Source:        .NET Runtime
Date:          03/05/2019 10:57:59
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Application: Test.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
   at System.Drawing.Bitmap..ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)
   at System.Drawing.Bitmap..ctor(Int32, Int32)
   at System.Drawing.Icon.BmpFrame()
   at System.Drawing.Icon.ToBitmap()
   at System.Windows.Forms.ThreadExceptionDialog..ctor(System.Exception)
   at System.Windows.Forms.Application+ThreadContext.OnThreadException(System.Exception)
   at System.Windows.Forms.Control.WndProcException(System.Exception)
   at System.Windows.Forms.Control+ControlNativeWindow.OnThreadException(System.Exception)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)

Log Name:      Application
Source:        Application Error
Date:          03/05/2019 10:58:00
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      xxxx
Faulting application name: 
Faulting module name: KERNELBASE.dll, version: 10.0.16299.1004, time stamp: 0x690aa820
Exception code: 0xe0434352
Fault offset: 0x00104622
Faulting process id: 0xa48
Faulting application start time: 0x01d501926a6eea35
Faulting application path:
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: f722f1dd-ce76-4968-8bef-4edceccabcb7
Faulting package full name: 
Faulting package-relative application ID: 
Event Xml:
<Event xmlns="">
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <TimeCreated SystemTime="2019-05-03T09:58:00.231417400Z" />
    <Security />
asked on Stack Overflow Feb 19, 2021 by Patryk

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0