Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

Dynamically load assembly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Boni - 05 May 2005 19:40 GMT
Dear Sirs,
If I dynamically load assembly into the memory by Load(byte[]) how long do I
have to preserve the array valid? Can it be destructed just after the load
call?
Thanks in advance,
Boni
Tomas Restrepo \(MVP\) - 06 May 2005 01:09 GMT
Boni,

> If I dynamically load assembly into the memory by Load(byte[]) how long do
> I have to preserve the array valid? Can it be destructed just after the
> load call?

You're in a GC world, meaning it's not your problem anymore :)

That said, I'd probably just leave it alone :)
Signature

Tomas Restrepo
tomasr@mvps.org

Boni - 06 May 2005 09:36 GMT
Hi,
thanks you Tomas.
But I meant with this question, what will be if the variable will go out of
scope?
I have a error, that if I load regestered assembly dynamically from an array
and then use XML Serilaization it throws the exception, where if I use
LoadFrom it is not. So my thougth is, that it need assembly, where the
buffer is allready destructed.

"Tomas Restrepo (MVP)" <tomasr@mvps.org> schrieb im Newsbeitrag
news:%23cXRu$cUFHA.2096@TK2MSFTNGP14.phx.gbl...
> Boni,
>
[quoted text clipped - 5 lines]
>
> That said, I'd probably just leave it alone :)
Tomas Restrepo \(MVP\) - 06 May 2005 12:14 GMT
Hi Boni,

> Hi,
> thanks you Tomas.
> But I meant with this question, what will be if the variable will go out
> of scope?

Again, not your problem. As long as there's a reference out there pointing
to the memory, it won't be GCd. I doubt this is your problem.

> I have a error, that if I load regestered assembly dynamically from an
> array and then use XML Serilaization it throws the exception, where if I
> use LoadFrom it is not.

What exception are you getting? The problem might very well have to do with
the fact that Load and LoadFrom use different load contexts, for example, or
due to the fact you're not passing any explicit evidence, or a whole other
set of things...

Signature

Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.