Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   When Are Supporting dll Assemblies Loaded Into AppDomain? (http://www.velocityreviews.com/forums/t539686-when-are-supporting-dll-assemblies-loaded-into-appdomain.html)

Smithers 09-24-2007 06:49 PM

When Are Supporting dll Assemblies Loaded Into AppDomain?
 
My ASP.NET Web app uses a few 3rd party assemblies. Just wondering when
those are loaded into the Web app's AppDomain - and for how long do they
stay loaded.

Is an assembly loaded the first time a page is loaded (where the page in
question makes use of the 3rd party assembly)? Or are all assemblies
referenced by the Web app automatically loaded whenever the Web site starts
(or is restarted)?

Thanks.



bruce barker 09-24-2007 07:38 PM

Re: When Are Supporting dll Assemblies Loaded Into AppDomain?
 
unless your code dynamically loads dlls (via the api), asp.net loads all
dll at startup (first request).

the .net runtime has no method to unload a dll. the appdomain must be
unloaded to release a dll.

-- bruce (sqlwork.com)


Smithers wrote:
> My ASP.NET Web app uses a few 3rd party assemblies. Just wondering when
> those are loaded into the Web app's AppDomain - and for how long do they
> stay loaded.
>
> Is an assembly loaded the first time a page is loaded (where the page in
> question makes use of the 3rd party assembly)? Or are all assemblies
> referenced by the Web app automatically loaded whenever the Web site starts
> (or is restarted)?
>
> Thanks.
>
>


Chris Fulstow 09-25-2007 04:27 AM

Re: When Are Supporting dll Assemblies Loaded Into AppDomain?
 
Hi

All the assemblies are loaded from the /bin folder as soon as your
application receives its first request.
The ApplicationManager creates a new AppDomain, which then loads your
third-party assemblies. They'll stay loaded for the lifetime of your
AppDomain.

To see exactly which assemblies are loaded at any point you can run
something like:

Dim assemblies() As Assembly = AppDomain.CurrentDomain.GetAssemblies()
For Each asm As Assembly In assemblies
Response.Write(String.Format("Loaded: {0}<br>", asm.FullName))
Next

Chris

On Sep 25, 4:49 am, "Smithers" <A...@B.com> wrote:
> My ASP.NET Web app uses a few 3rd party assemblies. Just wondering when
> those are loaded into the Web app's AppDomain - and for how long do they
> stay loaded.
>
> Is an assembly loaded the first time a page is loaded (where the page in
> question makes use of the 3rd party assembly)? Or are all assemblies
> referenced by the Web app automatically loaded whenever the Web site starts
> (or is restarted)?
>
> Thanks.





All times are GMT. The time now is 01:24 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.