0
votes

When I close the application by clicking the red X on the main form, the application closes, but visual studio does not exit debug mode. To do that, I have to click the stop button in VS. Pressing shift+F5 will not stop debugging either. I thought that I had just accidently changed a setting in my project, but this behavior now occurs for all of my projects.

As far as I know, I did not change any settings in Visual Studio, so I can't imagine why this would stop working all of a sudden.

2
sounds like closing the form does not end the application, thus VS stays in debug mode. - Ňɏssa Pøngjǣrdenlarp
well, without code it is hard to say, but if you have something in FormClosing to hide the form rather than let it die, the form would still be there but not visible and the app would be running. Also depends if you changed the Shutdown mode (project properties). - Ňɏssa Pøngjǣrdenlarp
I have not changed anything in the FormClosing event. I would have said that may be possible, but the behavior occurs for any of my vb projects that I try to run in visual studio, even projects that I have not opened or changed since they last worked. - Bernoulli Lizard
The Shutdown mode is set to 'when starup form closes', and I have never changed that property. - Bernoulli Lizard
The appllication will not quit even if run outside of VS. If I run the executable from the debug folder and attempt to close the application, the process does not quit. I have not rebuilt or even opened most of the projects that are not working, so I know the code has not changed. - Bernoulli Lizard

2 Answers

1
votes
Private Sub Window1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Me.Closing          
    End                             
End Sub

I was also facing that same problem. While clicking on cross button, it was closing the form but didn't stop debugging so I added this function in the main class. It worked

0
votes
      Private Sub Gui_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
        If Not IsNothing(wrk) Then
            'Request some cleaning
            wrk.RequestClosing()
        End If

        End ' this "End" statement seems requested 
            ' to allow proper exit from VS2019 debuging                     
            ' No further explanation is available.
------------------------------------------------------------------------

    End Sub