Problem loading plug-in DLLs with Assembly.LoadFrom()

Discussion in 'ASP .Net' started by Oenone, Jul 11, 2005.

  1. Oenone

    Oenone Guest

    I have created a number of "plug-in" DLLs for my ASP.NET application which
    are dynamically loaded at run-time. This is done by locating the DLL file on
    disk and loading it using the Assembly.LoadFrom(Filename) function.

    It's important that the DLLs are shadowed by ASP.NET so that they can be
    easily updated. To get this to work I have placed the DLLs into the bin\
    directory inside my web application. This seems to work fine.

    However, to reduce the clutter of DLLs I would like to put them into a
    sub-directory, bin\PlugIns\, but I'm having problems getting this to work.
    If I put the DLLs in the new directory and tell my app to load from that
    location (specifying the full path:
    D:\Work\MyWebApp\bin\PlugIns\MyPlugIn.dll) I get a
    "System.IO.FileLoadException: Access is denied" error. The error message
    also includes the following:


    === Pre-bind state information ===
    LOG: Where-ref bind. Location = D:\Work\MyWebApp\bin\PlugIns\MyPlugIn.dll
    LOG: Appbase = file:///D:/Work/MyWebApp
    LOG: Initial PrivatePath = bin
    Calling assembly : (Unknown).
    ===
    LOG: Private path hint found in configuration file: bin;bin\PlugIns.
    LOG: Policy not being applied to reference at this time (private, custom,
    partial, or location-based assembly bind).
    LOG: Attempting download of new URL
    file:///D:/Work/MyWebApp/bin/PlugIns/MyPlugIn.dll.


    As can be seen, I've tried adding bin\PlugIns to the probing path but it
    doesn't make any difference.

    Any suggestions?

    --

    (O)enone
    Oenone, Jul 11, 2005
    #1
    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. wolf
    Replies:
    4
    Views:
    7,852
    dcushnie
    Sep 11, 2006
  2. Timothy Parez

    Assembly.LoadFrom() & GAC

    Timothy Parez, Feb 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,607
    Timothy Parez
    Feb 22, 2004
  3. pkellner
    Replies:
    0
    Views:
    489
    pkellner
    Apr 27, 2007
  4. George Maney
    Replies:
    1
    Views:
    271
    Lucien
    Jan 22, 2004
  5. surya

    Problem using Assembly.LoadFrom within a web service

    surya, Jan 19, 2004, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    334
    surya
    Jan 19, 2004
Loading...

Share This Page