views:

244

answers:

2

hi,

my C# app is still in RAM after executing Application.Current.Shutdown();

(db connection is closed before)

(Application.Current.Exit += new ExitEventHandler(Current_Exit); is also used )

is there another statement to use ?

the problem occurs on different Windows Xp systems and on Server 2008.

kind regards, jeff

A: 

This happens if you still have running threads.

EricSchaefer
+3  A: 

If you spawned some threads, they might still be running. Either make sure they're finished before closing the application, or make sure you set the "IsBackground" property of the threads to "true" so they die with the application.

Badaro
If these threads aren't under your control, I suppose you can always kill your own process using something like Process.GetCurrentProcess().Kill().
Steven Sudit