I am using Assembly.LoadFrom within a web service to load assemblies from a web site. but the problem is it is in the virutal directory and the server.mappath parses the url like \share\mydll.dll and loadform method failed. Is there anyway to reference dll from the remote location?
I've tried passing the url (http://localhost/downloadable/mydll.dll) and again it got "Could not load file or assembly 'http://localhost/downloadable/mydll.dll' or one of its dependencies. HTTP down开发者_StackOverflowload of assemblies has been disabled for this appdomain. (Exception from HRESULT: 0x80131048)"
You can use the WebClient
class to download an assembly over the internet:
using(var wc = new WebClient()) {
Assembly.Load(wc.DownloadData(url));
精彩评论