Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - DLL unloading automatically

Reply
 
Old 3 Weeks Ago   #1 (permalink)
Yash Ganthe


 
 

DLL unloading automatically

Hi,

In my program, I load a DLL using Assembly.LoadFrom(). The program has
no Reference added to the DLL. It is loaded dynamically. The DLL has a
class with a static constructor. I can see that it executes when the
assembly is loaded. However, after a few hours, the static constructor
executes again. There is only one place in the program from which the
Assembly is loaded and this does not happen in a loop.
This makes me think that the assembly has got Unloaded somehow and has
automatically been reloaded. In what circumstances is this possible?
Is there any other explanation to the static constructor being
executed twice?

This is on .NET 3.0, C#

Thanks,
Yash

My System SpecsSystem Spec
Old 3 Weeks Ago   #2 (permalink)
Family Tree Mike


 
 

Re: DLL unloading automatically

Yash Ganthe wrote:
Quote:

> Hi,
>
> In my program, I load a DLL using Assembly.LoadFrom(). The program has
> no Reference added to the DLL. It is loaded dynamically. The DLL has a
> class with a static constructor. I can see that it executes when the
> assembly is loaded. However, after a few hours, the static constructor
> executes again. There is only one place in the program from which the
> Assembly is loaded and this does not happen in a loop.
> This makes me think that the assembly has got Unloaded somehow and has
> automatically been reloaded. In what circumstances is this possible?
> Is there any other explanation to the static constructor being
> executed twice?
>
> This is on .NET 3.0, C#
>
> Thanks,
> Yash
Try displaying the stack trace in the static constructor to see why it
might be called.

--
Mike
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Automatically log on after Sleep General Discussion
Automatically log on to network Vista General
Automatically add contacts Vista mail
contacts add automatically?!?! Vista mail
Automatically "Automatically get new IP settings for the network adapter" Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46