退出后 EXE 仍保留在任务管理器中

发布于 2024-08-02 15:47:02 字数 224 浏览 3 评论 0原文

我有一个用 WPF 和 WF 编写的 Windows 应用程序,它还通过 Quickbooks API 与外部 Web 服务和 Quickbooks 的本地副本进行交互。

一切工作正常,但唯一的问题是,即使我们退出 Windows 应用程序和 Quickbooks,我们仍然看到 Windows 应用程序可执行文件位于任务管理器中。

任何人都知道我们如何解决这个问题?

谢谢, 巴达伦

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心舞飞扬 2024-08-09 15:47:02

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().

早乙女 2024-08-09 15:47:02

只是猜测,但我会查看您的 WF 或 Quickbooks API 挂在其 Dispose() 调用上的情况。有时网络 API 太渴望正确清理,而不是直接关闭并让开。

处理此问题的一种方法是通过带有超时的 bg 线程。像下面这样的东西

        Action close = api.Dispose;
        var ar = close.BeginInvoke(cb => close.EndInvoke(cb), null);
        ar.AsyncWaitHandle.WaitOne(500);

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文