470,863 Members | 1,093 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

mixed assembly, unmanaged process, FreeLibrary (.NET 2.0)

DPR
Hi,

I've recognized that a mixed assembly with unmanaged exports and an
unmanaged "DllMain" can't be unloaded from a (unmanaged) process, even
if it's no longer needed and the (unmanaged) process calls the
"FreeLibrary" function.
I couldn't find any documentation for this special restriction ! So
isn't there any possibility to unload a mixed assembly manually from a
unmanaged process once it has been loaded without killing that process ?

I've tried to unload the whole CLR from the process in order to get the
assembly unloaded - but it seems that the CLR can't (???) be unloaded
from a running process once it has been loaded.

The MSDN documentation is very inconsistent as to this CLR behavior:

"CoUninitializeCor is obsolete. The common language runtime cannot be
unloaded from a process. To completely remove the runtime from a running
process, you must shut down that process."

ICLRRuntimeHost::Stop
"Do not call this method. The host cannot unload the runtime from a
process."

On the other hand:

ICorRuntimeHost::Stop
"Unloads the common language runtime from the current process."
[...]
"It is typically unnecessary to call this method, as the common language
runtime is automatically unloaded when the process exits.
Note:
After a call to Stop, the common language runtime cannot be
re-initialized into the same process."
Thanks for any help in advance !

--

DPR
Feb 6 '06 #1
0 1212

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Nadav | last post: by
1 post views Thread by =?Utf-8?B?SmltIFdhbHNo?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.