ravi
ravi

Reputation: 6338

Visual Studio is not stopping even after closing the app in debug mode

I am developing a windows form in c#. It is working fine but when I am running it in debug mode, I can see that visual studio is not stopping even after closing the form.

Below are some screenshots-

enter image description here

and

enter image description here

Probably my app is not releasing any resource. How can I deal with this problem? How to know which resource is still in use?

Upvotes: 1

Views: 3561

Answers (3)

Odys
Odys

Reputation: 9100

This can happen if you are using ApplicationContext instead of a form as the default message queue. If so, consider handling the form closing event of your form.

Upvotes: 2

Rahul Thotakura
Rahul Thotakura

Reputation: 49

You might want to try looking at the Processes from Start Task Manager. That could give you some information if a third party process initiated by the application is still running.

Upvotes: 0

drew_w
drew_w

Reputation: 10430

When I have seen this issue in the past it was because my application hasn't actually exited. This would most likely be because you or a dependency still has a thread running that hasn't stopped. You can tell if this is the case by looking at the task manager and checking for yourapplication.exe or yourapplication.vshost.exe. If either of these is open in the task manager you can kill it.

To fix this issue, make sure you call Abort() on all threads!

Upvotes: 1

Related Questions