How to fix *Microsoft .NET Framework Unhandled exception has occurred in your application. if you click Continue, the application will ignore this error and attempt to continue. Object reference no set to an instance of an object. *

Zuko Mel 0 Reputation points
2023-04-09T21:10:53.22+00:00

Details of the error:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at PhysicsWallah.Customer.frmOPTvarification.<btnVarification_Click>d__8.mGFyYlsVqLurGwR8mx7(Object )
   at PhysicsWallah.Customer.frmOPTvarification.<btnVarification_Click>d__8.MoveNext() in D:\Rishi(CodeBackup)DotNet\OfficeWork\PhysicsWallah_New - Latest\Customer\frmOPTvarification.cs:line 125
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)


************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Developer technologies Windows Presentation Foundation
Windows for business Windows Client for IT Pros User experience Other
{count} votes

1 answer

Sort by: Most helpful
  1. Scott, Lee Ann 0 Reputation points
    2023-04-28T10:45:50.6733333+00:00

    Here's what comes up for mine, any help is greatly appreciated.

    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    
    ************** Exception Text **************
    System.InvalidOperationException: Object is currently in use elsewhere.
       at System.Drawing.TextureBrush..ctor(Image image, WrapMode wrapMode)
       at System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g, Image backgroundImage, Color backColor, ImageLayout backgroundImageLayout, Rectangle bounds, Rectangle clipRect, Point scrollOffset, RightToLeft rightToLeft)
       at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
       at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
       at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
       at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)
       at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
       at System.Windows.Forms.Control.WmEraseBkgnd(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4614.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    NavXtender
        Assembly Version: 1.2.7104.32317
        Win32 Version: 1.2.7104.32317
        CodeBase: file:///C:/Program%20Files/Insight%20Works/NavXtender/NavXtender.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4550.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4605.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    log4net
        Assembly Version: 2.0.8.0
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.