开发者

Trying to unload unmanaged and managed third party dlls

开发者 https://www.devze.com 2023-02-12 03:57 出处:网络
Can you tell me please what is the best way to make garage collector to开发者_运维百科 unload unmanaged/managed third party dlls.There is no way to unload managed assembly in .NET. The only option is

Can you tell me please what is the best way to make garage collector to开发者_运维百科 unload unmanaged/managed third party dlls.


There is no way to unload managed assembly in .NET. The only option is to unload the entire AppDomain. See also:

  • Unloading an Assembly - Suzanne Cook's .NET CLR Notes


Managed code loads into Windows process into a 'default app domain', which is never unloaded until the process terminates.

CLR cant unload a single assembly; however a single AppDomain can be unloaded.

Calling AddRef & Release methods on ICLRRuntimeHost has no effects. [CLR is just like a COM Server]

Check MSDN link Why isn't there an Assembly.Unload method? http://blogs.msdn.com/b/jasonz/archive/2004/05/31/145105.aspx

To release unmanaged resources use IDisposable Interface.

A nice article on MSDN about Garbage Collection http://blogs.msdn.com/b/scottholden/archive/2004/12/28/339733.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号