When Are Supporting dll Assemblies Loaded Into AppDomain?

Discussion in 'ASP .Net' started by Smithers, Sep 24, 2007.

  1. Smithers

    Smithers Guest

    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.
    Smithers, Sep 24, 2007
    #1
    1. Advertising

  2. Smithers

    bruce barker Guest

    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.
    >
    >
    bruce barker, Sep 24, 2007
    #2
    1. Advertising

  3. 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" <> 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, Sep 25, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Konstantin Gonikman

    WebResource and dynamically loaded assemblies problem

    Konstantin Gonikman, Feb 17, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    395
    Konstantin Gonikman
    Feb 17, 2006
  2. Boris
    Replies:
    1
    Views:
    434
    Boris
    Jun 15, 2006
  3. Dave Burns
    Replies:
    2
    Views:
    637
    Dave Burns
    Jan 12, 2007
  4. Dave Burns
    Replies:
    0
    Views:
    395
    Dave Burns
    Jan 12, 2007
  5. Replies:
    1
    Views:
    407
    John Saunders
    Sep 13, 2008
Loading...

Share This Page