[Mono-list] Question about the lifetime of libraries loaded by a p/invoke

Petit Eric surfzoid at gmail.com
Mon Jul 21 19:32:11 EDT 2008


2008/7/22 Robert Jordan <robertj at gmx.net>:
> Maser, Dan wrote:
>>   The simple question is this:  When a .dll or .so is loaded by the
>> framework as the result of a p/invoke is that library guarenteed to stay
>> loaded for the duration of the hosting process?  Or can the framework
>> unload the dll if it wants to?  Is there anything in a spec that
>> indicates a standard behavior?  I've been trying to get this from the
>> microsoft documentation but I can't seem to find anything.


i see often lifetimeservices, but not sur this wath yu want because i
never use it, but this is something like that :

                               System.Windows.Forms.UserControl test = new
System.Windows.Forms.UserControl();
                               test.InitializeLifetimeService();

Gmail don't take the list by default.
>
> On MS.NET and Mono, P/Invoke libraries are treated like a compile
> time assembly reference and are never unloaded.
>
> If you want to unload native libraries you have to handle them
> with the machinery provided by the OS (dlopen, dlclose, LoadLibrary,
> etc.).
>
> Robert
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



-- 

Cordially.

Small Eric Quotations of the days:
---------------------------------------------------------------------------
If one day one reproaches you that your work is not a work of
professional, say you that:
Amateurs built the arch of Noah, and professionals the Titanic.
---------------------------------------------------------------------------

Few people are done for independence, it is the privilege of the powerful ones.
---------------------------------------------------------------------------

No key was wounded during the drafting of this message.


More information about the Mono-list mailing list