Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Assembly.LoadFrom(...)

Reply
Thread Tools

Assembly.LoadFrom(...)

 
 
Henrik de Jong
Guest
Posts: n/a
 
      07-08-2004
I'm using a sort of plugin mechanism in combination with a commandfactory
(pluginfactory). This factory looks in a special dir when it's starting.
Each assembly(*.dll) will be loaded with Assembly.LoadFrom(assemblyname).
After loading, it walks through all types in the assembly looking for a
info-object. When this info-object is found, then it should be a known
plugin-assemlby.

My question is how to unload these assemblies?

Kind regards,
Henrik


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      07-08-2004
Hi Henrik:

Unfortunately you can't unload an assembly. MS gives several reasons
for this, one being that the runtime can't be sure there isn't some
thread still executing code in the assembly. The runtime would also
have to go throw the memory heap used by the JIT and remove compiled
methods to completely unload an assembly, and the design just isn't
optimized for this scenario - it's optimized for adding new compiled
methods.

The workaround is to create a new application domain for your
plug-ins, and unload the app domain. This has a price to pay in
performance because you've introduced a remoting boundary.

HTH,

--
Scott
http://www.OdeToCode.com

On Thu, 8 Jul 2004 11:50:52 +0200, "Henrik de Jong" <(E-Mail Removed)>
wrote:

>I'm using a sort of plugin mechanism in combination with a commandfactory
>(pluginfactory). This factory looks in a special dir when it's starting.
>Each assembly(*.dll) will be loaded with Assembly.LoadFrom(assemblyname).
>After loading, it walks through all types in the assembly looking for a
>info-object. When this info-object is found, then it should be a known
>plugin-assemlby.
>
>My question is how to unload these assemblies?
>
>Kind regards,
>Henrik
>


 
Reply With Quote
 
 
 
 
Natty Gur
Guest
Posts: n/a
 
      07-08-2004
Hi,

you simply can't. here explanation of one of the CLR team :
http://weblogs.asp.net/jasonz/archiv...31/145105.aspx

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments