How do I unload an assembly?

5 views
Skip to first unread message

.NetIndia

unread,
Oct 19, 2005, 6:24:56 AM10/19/05
to dotNetIndia

How do I unload an assembly?



--
Regards,
.NetIndia Group,
"There is no delight in owning anything unshared."
"A book lying idle on a shelf is wasted ammunition. Like money, books must be kept in constant circulation. Lend and borrow to the maximum -- of both books and money! But especially books, for books represent infinitely more than money. A book is not only a friend, it makes friends for you. When you have possessed a book with mind and spirit, you are enriched. But when you pass it on you are enriched threefold."

Blog:http://dotnetindia.blogspot.com/

Bala murugan

unread,
Oct 19, 2005, 7:10:07 AM10/19/05
to Techdot...@googlegroups.com
hi,

gacutil -u <assembly_name>.dll

Thread

unread,
Oct 19, 2005, 7:18:24 AM10/19/05
to .NetIndia
Hi Bala,

This command is to remove the assembly from GAC. The question is how to
unload from the project..

Regards
Thread

BabuLives

unread,
Oct 19, 2005, 7:31:19 AM10/19/05
to .NetIndia
Ya...it is how to unload the assembly?Is it possible or not?

Regards,
Satheesh

Raja Prakash

unread,
Oct 19, 2005, 8:09:42 AM10/19/05
to Techdot...@googlegroups.com
hey guys..
 
          You cal unload only appdomain but not your assembly... you can do onething.. you can add new functions to you assembly at runtime... like creating one appdomain and load those functions to the existing assembly.... will soon send you guys a document... right now i can't...
 
byeee...
raj..

 

Shivprasad Koirala

unread,
Oct 19, 2005, 11:33:27 PM10/19/05
to .NetIndia
assembly is unloaded by garbage collector....But still if you want to
forcibily do it

gc.collect()

-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Raja Prakash

unread,
Oct 19, 2005, 11:56:49 PM10/19/05
to Techdot...@googlegroups.com
hey..
 
         is it so?  I thought it is for collecting objects that dont have any reference to the application...
 
byee...
raj...

 

Thread

unread,
Oct 20, 2005, 1:35:01 AM10/20/05
to .NetIndia
Hi Shiv

Can you please provide some references about your saying. Because even
i think it is for collecting objects that dont have any reference to
the application..

Regards
Manish

BabuLives

unread,
Oct 20, 2005, 5:12:27 AM10/20/05
to .NetIndia
We cannot unload a assembly but even then if we want to unload a
assembly we have unload the application domain itself.

The method for unloading the application domain is..

public static void Unload(AppDomain domain)


Regards,
Satheesh

Raja Prakash

unread,
Oct 20, 2005, 5:48:28 AM10/20/05
to Techdot...@googlegroups.com
Satheesh...
 
         I dont want that... domain should be there and i should replace that assembly by another assembly.... got it
 
byeee...
raj...

 

Thread

unread,
Oct 20, 2005, 7:19:30 AM10/20/05
to .NetIndia
This is to Load an Assembly at runtime:

Imports System.Reflection

Class Class1
Public Shared Sub Main()
Dim SampleAssembly As [Assembly]
' You must supply a valid fully qualified assembly name here.

SampleAssembly = [Assembly].Load("Assembly text name, Version,
Culture, PublicKeyToken")
Dim Types As Type() = SampleAssembly.GetTypes()
Dim oType As Type
' Display all the types contained in the specified assembly.
For Each oType In Types
Console.WriteLine(oType.Name.ToString())
Next oType
End Sub 'LoadSample
End Class 'Class1


To unload there is one way create a new appdomain
Go thru this site.

http://www.dotnet247.com/247reference/msgs/56/284238.aspx

http://www.ms-inc.net/PluginInfo.aspx

There is no Assembly.Unload method

Regards
Thread

Reply all
Reply to author
Forward
0 new messages