472,117 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,117 software developers and data experts.

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.
Sep 24 '07 #1
2 1723
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.

Sep 24 '07 #2
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.comwrote:
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.

Sep 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by dale cyr | last post: by
6 posts views Thread by Outshined | last post: by
2 posts views Thread by Arthur Roodenburg | last post: by
1 post views Thread by Robert Vasquez | last post: by
4 posts views Thread by Barry Kelly | last post: by
1 post views Thread by =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post: by
1 post views Thread by =?Windows-1252?Q?Tor_B=E5dshaug?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.