After I close the main window of my program, the process is still running in the background.
How can I check what is the cause for this weird problem?
(I don’t know which part of my program code is relevant)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First check that the value of your application’s
ShutdownModeproperty is equal toShutdownMode.OnMainWindowClose— if it is not, see if the actual value is preventing the app from closing.If this does not solve the problem, then you have one or more non-background threads still running after the main window closes, preventing the process from shutting down. Break into the debugger and see how many threads are still alive and what they are doing; this will lead you to a solution.