sanchop22 sanchop22 - 8 months ago 63
C# Question

Debug not stopping after form closing in Visual Studio

Visual Studio Debug does not stop when i close the form that i write in C#. How can i stop debug process when i close form. I added Application.Exit() method in the form closing event but it didn't work.

Thank you.

Answer Source

Try this from here

If (System.Windows.Forms.Application.MessageLoop)
  // Use this since we are a WinForms app
  // Use this since we are a console app


If there are running infinite threads then do

Thread myThread = new Thread(...);
myThread.IsBackground = true; //set your running thread to background

And you can see how to? from here