views:

255

answers:

2

Hi All,

I have an windows application written in WPF and WF which also interacts with external web services and a local copy of Quickbooks via Quickbooks API.

Everything is working nicely, however the only problem is even after we quit the windows application and Quickbooks, we still see the windows application executable sitting in the task manager.

Anyone has any idea how we can solve this?

thanks, badallen

A: 

Just a guess, but I'd look to your WF or quickbooks API hanging on their Dispose() calls. Sometimes network APIs are too eager to clean up properly, instead of just closing and getting out of the way.

One way to handle this is via a bg thread w/ a timeout. Something like the following

        Action close = api.Dispose;
        var ar = close.BeginInvoke(cb => close.EndInvoke(cb), null);
        ar.AsyncWaitHandle.WaitOne(500);
Scott Weinstein
+1  A: 

Could it be an issue related to Application.ShutDownMode? The property might be set to ShutDownMode.OnExplicitShutDown and there might be no call to Application.ShutDown().

Daniel Brückner
Thank you, that seems to does the trick.
badallen