VB .NET Stack Overflow System.StackOverflowException

0

I am getting a stack overflow after I click the X on the form to close. It happens right after the form closed event. I am using Visual Studio 2017 and VB .NET. Any ideas how to trace this down? Call stack seems small to cause an overflow. Also, why is it going to assembly, even the things in the call stack go to assembly for me when I double click. Error:

        System.StackOverflowException
  HResult=0x800703E9
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

My code:

  Private Sub frmViewAll_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Try
            formClosing_Renamed = True
            'JC.Global.StudyForm.Activate() 
        Catch ex As Exception

        End Try
    End Sub

Asseembly: 00007FF9204C150D mov byte ptr [rbx+0Ch],1

Call stack:

[Managed to Native Transition]  
>   System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Form.DefWndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)   Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Form.WmSysCommand(ref System.Windows.Forms.Message m) Unknown
    DevExpress.Utils.v17.1.dll!DevExpress.XtraEditors.DForm.WndProc(ref System.Windows.Forms.Message m) Unknown
    DevExpress.Utils.v17.1.dll!DevExpress.XtraEditors.XtraForm.WndProc(ref System.Windows.Forms.Message msg)    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam)  Unknown
    [Native to Managed Transition]  
    [Managed to Native Transition]  
    System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData)  Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context)    Unknown
    System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
    Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() Unknown
    Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()    Unknown
    Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(string[] commandLine)   Unknown

I was able to simplify code to this and still get the error so it must be a designer issue:

Friend Class frmTestForm
    Inherits DevExpress.XtraEditors.XtraForm
    Public Sub setMode(test As Boolean)

    End Sub

End Class

Designer With Everything commented out has the issue still:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class frmTestForm

#Region "Windows Form Designer generated code "

    ' <System.Diagnostics.DebuggerNonUserCode()>
    Public Sub New()
        MyBase.New()


        'This call is required by the Windows Form Designer.
        InitializeComponent()
    End Sub


    'Form overrides dispose to clean up the component list.
    '<System.Diagnostics.DebuggerNonUserCode()>
    Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
        If Disposing Then
            If Not components Is Nothing Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose()
    End Sub
    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    '<System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        'Me.SuspendLayout()
        '
        'frmTestForm
        '
        'Me.Appearance.Options.UseFont = True
        'Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 14.0!)
        'Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(984, 575)
        'Me.Cursor = System.Windows.Forms.Cursors.Default
        'Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        'Me.Location = New System.Drawing.Point(286, 233)
        'Me.MinimumSize = New System.Drawing.Size(650, 450)
        'Me.Name = "frmTestForm"
        'Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        'Me.Text = "View All Questions/Answers"
        'Me.ResumeLayout(False)
        'Me.PerformLayout()

    End Sub
    'Friend WithEvents txtSearch As System.Windows.Forms.TextBox
#End Region
End Class

Error is happening on the MyBase.Dispose()

vb.net
visual-studio
asked on Stack Overflow Aug 26, 2020 by Jeff • edited Aug 27, 2020 by Jeff

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0