Hang when reloading a mixed mode CLR/C++ assembly using LoadLibrary
-
09 Maret 2012 14:22
We are writing a plugin to a software application that requires a mixed mode C++/CLI dll. The interface is exposed to applications as four exposed functions in the DLL. The application will load the library using LoadLibrary to get some initial information and then call FreeLibrary after the initial call. When it is ready to use the library again it will call LoadLibrary and then call the method.
There are actually several clients that use this pattern and we aren't having any issues except for one of the applications. The application with the problem is hanging after the second call to LoadLibrary when it tries to call into the assembly.
The difference between the applications that work and the one that doesn't work is the fact that the path to the assembly is being passed in with forward slashes instead of backwards slashes.
I found in http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx
that the API says not to use the forward slash when specifying the path name, but there are many plugins that are unmanaged that are being called with the forward slash that do not have the problem.
I'm looking for an explanation for what is causing the hang.
I have sample code, but I don't see how to post it here. This is the first time I've asked a question on these forums.
- Diedit oleh Steven C Mitcham 09 Maret 2012 14:23
Semua Balasan
-
10 Maret 2012 10:37
Hi Steven,
Welcome to MSDN forums !!!
If OS finds the deadlock or dependency loop, then usually the hanging issue occurs. Checkout his post it is mentioned here:
http://msdn.microsoft.com/en-us/library/aa290048(v=vs.71).aspx
Regards, http://shwetamannjain.blogspot.com
- Disarankan sebagai Jawaban oleh Shweta Jain 10 Maret 2012 10:37
- Ditandai sebagai Jawaban oleh Mike FengMicrosoft Contingent Staff, Moderator 20 Maret 2012 9:07