Program still running after close

  • Thread starter Thread starter Dave Griffiths
  • Start date Start date
D

Dave Griffiths

Hi All

Using vb 2005

I have noticed that sometimes (not everytime) after closing a program I
have written it is still running in the task manager.

The programs are very short, just small utilities for my job. I am
using just the exe copied from the bin\release folder. I Have have also
tried to publish and install and that produces the same problem.

I am relatively naive programmer, I am sure there is something I am not
including in the program that would clean up for me.

Thanks in advance
 
Dave Griffiths said:
I have just seen Kimiraikkonen post below I will follow that.

I answer here because he uses the Express version (which I can not answer).
If you don't, go into debug mode (Ctrl+Break), open the Threads window (not
available in the Express version) and look at the callstack to see what the
application is doing.


Armin
 
OK Armin I have done that but I have not a clue what I am looking for.

There are 9 entries in the Threads Window after Ctrl + Break

ID Name Location Priority Suspend
3456 0
4124 <No Name> Highest 0
6084 0
2864 <No Name> Normal 0
3240 <No Name> Normal 0
3260 <No Name> Normal 0
5944 <No Name> Normal 0
4008 .Net SystemEvents Normal 0
2912 <No Name> Normal 0

In the Output Window.

'VAT Calculator.vshost.exe' (Managed): Loaded
'C:\Users\DaveG\Documents\Visual Studio 2005\Projects\VAT
Calculator\VAT Calculator\bin\Debug\VAT Calculator.exe', Symbols loaded.
'VAT Calculator.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561
934e089\System.Runtime.Remoting.dll', No symbols loaded.
The thread '<No Name>' (0xca8) has exited with code 0 (0x0).
The thread '<No Name>' (0x1738) has exited with code 0 (0x0).
The thread '<No Name>' (0xb60) has exited with code 0 (0x0).
The thread 0x17c4 has exited with code 0 (0x0).
The thread '<No Name>' (0xb30) has exited with code 0 (0x0).
The program '[4324] VAT Calculator.vshost.exe: Managed' has exited with
code 0 (0x0).

I hope you can make some sense of this.
 
Dave Griffiths said:
OK Armin I have done that but I have not a clue what I am looking
for.

There are 9 entries in the Threads Window after Ctrl + Break

ID Name Location Priority Suspend
3456 0
4124 <No Name> Highest 0
6084 0
2864 <No Name> Normal 0
3240 <No Name> Normal 0
3260 <No Name> Normal 0
5944 <No Name> Normal 0
4008 .Net SystemEvents Normal 0
2912 <No Name> Normal 0

In the Output Window.

'VAT Calculator.vshost.exe' (Managed): Loaded
'C:\Users\DaveG\Documents\Visual Studio 2005\Projects\VAT
Calculator\VAT Calculator\bin\Debug\VAT Calculator.exe', Symbols
loaded. 'VAT Calculator.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561
934e089\System.Runtime.Remoting.dll', No symbols loaded.
The thread '<No Name>' (0xca8) has exited with code 0 (0x0).
The thread '<No Name>' (0x1738) has exited with code 0 (0x0).
The thread '<No Name>' (0xb60) has exited with code 0 (0x0).
The thread 0x17c4 has exited with code 0 (0x0).
The thread '<No Name>' (0xb30) has exited with code 0 (0x0).
The program '[4324] VAT Calculator.vshost.exe: Managed' has exited
with code 0 (0x0).

I hope you can make some sense of this.

Unfortunately not much from here because I'd double-click the threads having
the callstack window opened to see what each thread is doing.

What is the startup object of your application (project properties)? Is it a
Form or sub main? Is the Application Framework enabled? What is the
application shutdown setting ("when closing the start form" or "when closing
the latest form" (or similar))?

I guess you have a Form as the startup object. How do you close it?


Armin
 
Hi All

The first time the program is run it closes and the process is removed
from the Task Manager List, however on the second execution of the
program when it is closed it does not remove it'self from the Task
manager List. Every execution afterwards leaves another process running.

I can post the code if you wish. The utility is less than 60 lines.
 
It's not ideal, but a workaround for now would be to use:

Application.Exit()


That will terminate your program (So make sure its saved everything
first!)..


Suprisingly enough i have never had this issue. Are both of you on Vista
by any chance? (I hate vista and vb, it runs slower than my P4).
 
Hi Tom

Yes I am on Vista but I have not noticed much of a degregation in speed
but then I do have 4Gb Ram and a 2.4Ghz Intel Core2 CPU.

Thanks for the suggestion I have just run the program on Win XP SP2
machine and it behaves correctly.

My next question is how do I report this problem to the powers that
need to know and that can help resolve the issues.
 
Back
Top