Welcome to irritatedVowel.com Sign in | Help

POKE 53280,0: Pete Brown's Blog

Silverlight, WPF, Woodworking, .NET Programming, CNC, Nature, and other topics.

Pete Brown writes on a number of topics including Silverlight, WPF, .NET, woodworking and working as a consultant in the DC area. On most forums, Pete goes by the name Psychlist1972. Pete has worked at Applied Information Sciences (AIS) since 1996 where he currently performs as a lead architect and project manager.

Subscribe to my feed

Add to Technorati Favorites
Applied Information Sciences - My Employer

Community Events



World Domination

who's online

Networks


View Pete Brown's profile on LinkedIn

AddThis Social Bookmark Button

More on How Assemblies are Downloaded in Silverlight 1.1

Assem in this thread on Silverlight.net pointed out that the downloader object isn't required to get assemblies down to the local machine in Silveright 1.1 (September alpha).

I didn't believe that, so I did a test. Guess what? He's absolutely right. Calling Assembly.Load(name) is sufficient to cause the assembly to be downloaded to your workstation. Thinking about it in retrospect, that makes perfect sense, as that is likely how the initial assemblies listed in the xaml file are brought down. However, I'd need to test myself to be sure of that :)

So, in the case of something like the assembly preloader I wrote about, the downloader object providers finer-grained control over the downloading of assmblies, but it isn't strictly required. If you want to load a single plugin, or a couple plugins, and they aren't overly large, you can just call Assembly.Load. If they are larger, which would probably necessitate the use of a preloader, you can use the Downloader object to get them for you, and then call Assembly.Load().

  Add to Technorati Favorites
Posted: Sunday, November 18, 2007 7:56 PM by Pete.Brown
Filed under: ,

Comments

Mike Wolf said:

yah, your solution gives the added benefit of giving the flexibility of responding w/ download progress and all the goodness that comes w/ the downloader. For example, I did some experimentation w/ skining and found that, just be adding the reference in the project, I was able to gain a handler on an assembly just by instantiating an object w/ in it, and then you could retrieve assets out of it. so for example TwitterGadget.Skins.Loader loader = new TwitterGadget.Skins.Loader(); System.IO.Stream s = loader.GetType().Assembly.GetManifestResourceStream(xaml); where loader is an empty class, accomplishes the same as Assembly.Load();
# November 18, 2007 9:56 PM

Christopher Steen said:

Announcements Krypton 2.6.5 CTP Released [Via: Phil Wright ] ASP.NET MS MVC and the MVC Team [Via:...
# November 19, 2007 12:29 AM

WynApse said:

Silverlight Cream for November 19, 2007 -- #128
# November 19, 2007 5:38 PM

Community Blogs said:

Catching up on items I've located -- looks like I waited too long: Jesse Liberty explains the Expression
# November 19, 2007 6:23 PM

Curt Williams said:

Can these techniques for downloading assemblies be used to load assemblies that operate outside the Silverlight sandbox? i.e. Can I download an assembly that targets the regular .NET framework and not the limited Silverlight version of the framework? I really want to break out of the sandbox and interact with local system. Can I sign my assembly and have the user prompted if they want to trust the signer or not? Is there a main-stream/supported/secure way to have a Silverlight application interact with the local system after the user accepts some security prompts? Thanks
# February 11, 2008 7:31 PM

Pete.Brown said:

Hi Curt

You won't be able to reference any other assemblies to break out of the sandbox, or else it wouldn't be a very secure sandbox :)

If you want to make your application Windows-only, you can get similar functionality by using WPF XBAPs or by putting a custom-written activeX control on your page to do the dirty work for you.

In addition, full-CLR assemblies are not compatible with Silverlight at a binary level as they target different runtimes. THe only way to share code between the platforms is to do it at a source level.

Pete

# February 11, 2008 8:48 PM

Curt Williams said:

Thanks for the response Pete. In ASP/AJAX web development we see controls like those used to compress & upload photographs which are trusted, and which have access the local file system. Shouldn't there be some kind of parallel in the Silverlight world so that these types of features can be built using Silverlight? Would you anticipate that some type of security/trust features would be added to Silverlight in the future? Of course you don't want applications getting out of the sandbox without user consent, but it seems like there are cases when it is needed. What do you think?
# February 11, 2008 9:31 PM

Pete.Brown said:

I agree. Having the ability to open a file (in a secure way, requiring the user to pick the file) would be a good thing to have in Silverlight. I can see all sorts of uses for that.

Pete

# February 11, 2008 10:17 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Enter the text you see in the image:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS