Then just feed all the Plugin objects to the PluginDownloader and it goes off and gets them. New Plugin(", Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", new Uri("ClientBin/.dll", UriKind.Relative)) Main assembly knows nothing of the files, queries the server for plugin assembly name and location then creates a Plugin object from my Utilis library like so: Work if the assembly is downloaded using the Downloader class, and it must be in the ClientBin folder (i tried using a seperate /plugins/ folder but it also failed, i think anyway from memory). I did have to play around a bit before settling on this solution, initially tried downloading from anywhere and just loading a byte but Assembly.Load hates that, which landed me in the position that it'll only Cleared browser cache, and installed fiddler to check it out, added a 5 second Thread.Sleep() before it started looking for plugins, and there was a 5 second delay (at a guess, i wasn't actually timing) before fiddler showed the http requests for theģ. Unless that changes and Assembly.Load is made SafeCritical, or a SafeCritical alternative is provided, it destroys the idea of background downloading assemblies and having a real componentized or plugin-style application model.ġ. Return InternalLoad( assemblyRef, null, ref lookForM圜aller, false)
StackCrawlMark lookForM圜aller = StackCrawlMark.
Public static Assembly Load( AssemblyName assemblyRef) Sure enough, after loading it up in Reflector, I see it is indeed marked as such: This one), I have to conclude that Assembly.Load(string) is considered critical and therefore, despite being exposed, is not something we can call from our application code. This thread which I completely missed the first time around:įrom reading the referenced articles (like That seemed like a really an odd exception to get back given its usual interpretation, so I googled and managed to find "Attempt to access the method failed: (System.String)" However, calling Assembly.Load on the assembly (whether I just force it local or actuallyĭownload it), resulted in a System.MethodAccessException on Assembly.Load( assemblyname).
#Clr browser source plugin not showing up code#
So, I was able to download the assemblies just fine using the downloader, and I have the code in place to do everything I need to do with them to get them on the canvas. The main one is the failure of Assembly.Load to actually load the assembly. So tonight I decided to try and work up a sample. There have been a number of posts lately about downloading assemblies in the background.