By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,665 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,665 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.