PC Review


Reply
Thread Tools Rate Thread

Assemply and using Activator.CreateInstance

 
 
Hulk
Guest
Posts: n/a
 
      21st Jun 2006
Hello All,

If I load an Assembly (.DLL file) from Process (.Exe file)
using Activator.CreateInstance() method are there or should
I remove Assemply (.DLL) from memory after using it with
Activator's method other method?

I would like to know that are there any possibilities that Assembly
will
remain in memory after process (.exe) is exited.

Have anyone of you any ideas about this?

Cheers!

 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      21st Jun 2006
Unloading assemblies from an AppDomain is a pain and not (IIRC)
recommended; any specific reason you want to do it? The other thing to
try is loading it in a separate AppDomain that you can trash
afterwards.

Marc

 
Reply With Quote
 
Marc Gravell
Guest
Posts: n/a
 
      21st Jun 2006
Maybe I misread your intent slightly:
>after process (.exe) is exited


Well, if the /process/ ends, then everything loaded in that process
ends; it is, however, possible for a process to outlive the Main()
method if you fire up a non-background thread: the process lives as
long as there is a non-background thread alive - very useful for
writing server applications where the Main() method just kicks things
off.

Marc

 
Reply With Quote
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      21st Jun 2006
Hi,

"Hulk" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello All,
>
> If I load an Assembly (.DLL file) from Process (.Exe file)
> using Activator.CreateInstance() method are there or should
> I remove Assemply (.DLL) from memory after using it with
> Activator's method other method?


IIRC you cannot unload an assembly from memory. You would have to create
another appdomain and then unload it. A PITA if you ask me.

> I would like to know that are there any possibilities that Assembly
> will
> remain in memory after process (.exe) is exited.
>
> Have anyone of you any ideas about this?



It will not, it will be unloaded when your appdomain ends.



--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activator.CreateInstance =?Utf-8?B?Q29kZVJhem9y?= Microsoft C# .NET 1 26th Apr 2006 07:14 PM
Need help with Activator.CreateInstance() =?Utf-8?B?UXVpbWJseQ==?= Microsoft Dot NET 1 17th Jan 2006 08:52 PM
Difference Between assembly.CreateInstance and System.Activator.CreateInstance John Jenkins Microsoft C# .NET 1 14th Oct 2004 10:00 PM
Difference Between CurrentDomain.CreateInstance and Activator.CreateInstance b0yce Microsoft Dot NET 0 23rd Mar 2004 03:56 PM
Difference Between CurrentDomain.CreateInstance and Activator.CreateInstance b0yce Microsoft C# .NET 0 22nd Mar 2004 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:16 PM.