Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
DLL unloading automatically
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Yash Ganthe  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 16:45
Newsgroups: microsoft.public.dotnet.general, microsoft.public.dotnet.framework, microsoft.public.dotnet.languages.csharp
From: Yash Ganthe <yas...@gmail.com>
Date: Tue, 3 Nov 2009 08:45:27 -0800 (PST)
Local: Tues 3 Nov 2009 16:45
Subject: 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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Family Tree Mike  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 22:33
Newsgroups: microsoft.public.dotnet.general, microsoft.public.dotnet.framework, microsoft.public.dotnet.languages.csharp
From: Family Tree Mike <FamilyTreeM...@ThisOldHouse.com>
Date: Tue, 03 Nov 2009 17:33:12 -0500
Local: Tues 3 Nov 2009 22:33
Subject: Re: DLL unloading automatically

Try displaying the stack trace in the static constructor to see why it
might be called.

--
Mike


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Dunaway  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 14:34
Newsgroups: microsoft.public.dotnet.general, microsoft.public.dotnet.framework, microsoft.public.dotnet.languages.csharp
From: Chris Dunaway <dunaw...@gmail.com>
Date: Thu, 5 Nov 2009 06:34:17 -0800 (PST)
Local: Thurs 5 Nov 2009 14:34
Subject: Re: DLL unloading automatically
On Nov 3, 10:45 am, Yash Ganthe <yas...@gmail.com> wrote:

Unless you loaded the assembly in a separate AppDomain, I don't think
it will be unloaded until the App closes.

I'm not sure how instances of static classes are handled by the
garbage collector, but perhaps your class is being collected somehow,
so that the next time you access the static members, the static
constructor is being executed again.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google