Debugger doesn't stop running when application exits

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I am writing a PocketPC 2002 app using C# and Visual Studio .NET 2003. I have disabled "Smart Minimize" by setting my MinimizeBox property to false.

When I click the "OK" button, I am trapping the Closed event for my form. When I step through, after the form closed event, my code returns from Applicaton.Run() and leaves the Main function. If I then look on my PocketPC device at the running programs, my application is NOT listed. However, then Visual Studio .NET 2003 debugger does not stop running. I am forced to hit the "Stop" button. This then causes the machine to "hold open" the EXE that it makes, so if I want to deploy the project again to the device, I have to shut down my IDE and do it again. This is unacceptable

I have downloaded a sample application (the Serial Communications Sample) from Microsoft and I am setting up my project and Main form the same way the sample does (as far as I can tell), but in their sample, when the OK button is pressed, the application AND the debugger stop. This is the behavior I require

Can anyone make suggestions? If you need more info, please let me know and I will get it for you. Thanks in advance!
 
Something in the App is still running. Are you launching any threads?
Calling Application.Exit() in the Form.Close() event will take care of the
problem.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Brent Lang said:
Hello.

I am writing a PocketPC 2002 app using C# and Visual Studio .NET 2003. I
have disabled "Smart Minimize" by setting my MinimizeBox property to false.
When I click the "OK" button, I am trapping the Closed event for my form.
When I step through, after the form closed event, my code returns from
Applicaton.Run() and leaves the Main function. If I then look on my
PocketPC device at the running programs, my application is NOT listed.
However, then Visual Studio .NET 2003 debugger does not stop running. I am
forced to hit the "Stop" button. This then causes the machine to "hold
open" the EXE that it makes, so if I want to deploy the project again to the
device, I have to shut down my IDE and do it again. This is unacceptable.
I have downloaded a sample application (the Serial Communications Sample)
from Microsoft and I am setting up my project and Main form the same way the
sample does (as far as I can tell), but in their sample, when the OK button
is pressed, the application AND the debugger stop. This is the behavior I
require.
Can anyone make suggestions? If you need more info, please let me know
and I will get it for you. Thanks in advance!
 
Thank you, that worked

Since I am using Microsoft's same Serial class, there are other threads running. However, I did try commenting out all references to the class trying to avoid the threads from spawning. I did add that call to Applicaton.Exit where you suggested and it worked. Thank you
 
Just FYI, the MSDN Serial sample code is a bit dated. We've made some mods
and significant bug-fixes since it was published, so getting the latest may
be a good idea.

www.opennetcf.org

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Brent Lang said:
Thank you, that worked.

Since I am using Microsoft's same Serial class, there are other threads
running. However, I did try commenting out all references to the class
trying to avoid the threads from spawning. I did add that call to
Applicaton.Exit where you suggested and it worked. Thank you
 
Back
Top