我怎样才能释放由未运行的exe文件称为一个DLL?文件、exe、DLL

2023-09-04 04:53:10 作者:每天都被自己帅醒¬ε¬

我有依赖于DLL中的窗口服务。该服务是否正在运行与否,它的可执行文件是保持一个句柄DLL,这是$ P $自动更新它pventing我。

I've got a windows service that relies on a DLL. Whether the service is running or not, its executable is keeping a handle to that DLL, which is preventing me from updating it automatically.

这是为什么,我怎么可以删除处理编程($ P $通过净pferably)?

Why is this, and how can I remove that handle programatically (preferably via .Net)?

更新: 我知道该服务的可执行文件是一个与把手,因为我跑handle.exe的DLL,只有服务的exe文件上来。没有拐杖,当我运行它的exe文件,我知道该服务没有运行,因为我检查了服务列表。没有别的,这将是使用,我能想到的DLL。

Update: I know that the service's executable is the one with the handle because I ran handle.exe on the dll and only the service's exe came up. Nothing cane up when I ran it on the exe and I know that the service isn't running because I checked the services list. There is nothing else that would be using the dll that I can think of.

推荐答案

这是一个讨厌的小问题。该服务有两个线程,其中一个执行一个非常微妙的,不经常需要的功能,我没有注意到,这是越来越僵持不下的共享资源。所以这是挂,无限期,这是什么让我的可执行经营,尽管该服务被关停。修复这个问题解决了我的文件句柄问题。

This was a nasty little problem. The service has two threads, and one of them performs a very subtle, not frequently needed function, and I did not notice that it was getting deadlocked over a shared resource. So it was hanging, indefinitely, which is what was keeping my executable engaged, despite the service being shut down. Fixing that issue resolved my file handle issue.

感谢您的建议,所有的。

Thanks for the suggestions, all.