I have created a silverlight app on my website. In Visual Web Developer 2010, I have one website project, and one C#/Silverlight project. Naturally my website project contains the XAP file in the ClientBin. However, my XAP file is HUGE and really takes a long time to load. I am trying to find a way where I can exclude all my content from my silverlight app to make it smaller, and upload my content (images, XML files, and audio) to my DASP FTP server.....then whenever my silverlight app actually needs that data, it can download the file from the FTP server. I am trying to find the best method to do this and was hoping for some suggestions. I am having so many problems with silverlight's webclient and httprequest. I was hoping for another solution: WCF perhaps? Any insight or anyone who has experience with this issue please let us all know! Thanks so much in advance!
Hi, How large is it? btw, did you see this? http://community.discountasp.net/showthread.php?t=10683 All the best, Mark
I am using silverlight, with Silversprite (www.silversprite.codeplex.com) to create a game and put it on my website. So my XAP is ridiculously huge....I'm almost embarrased to say that it is 80MB....so it takes about 6 minutes to download on a standard machine. It you have a good network card it takes about 2-3 minutes. I really need a good solution for downloading content on demand from my FTP server when my XAP needs it. Like, putting on my content for a specific level into a zip file, and my silverlight app can download that before playing the level. I have just been unable to get a sample of that working; it seems I can't connect to my FTP FROM my silverlight app. Any other suggestions?
...There is one person I know who may have some ideas for you, it's my friend Victor. Are you on Twitter? is so ping him @victorgaudioso If not send him an Email and tell him Mark Wisecarver recommended you to ask about this. wpfauthor(REMOVETHIS)@gmail.com *Remove the brackets and the text inside them, did that for the bots crawling this forum. All the best, Mark
It's an old one from Mike Taulty but the method will still work today. He demonstrates dynamically loading an assembly; the same can be applied to other resources persisted on the server: http://www.silverlightshow.net/items/Silverlight-Dynamically-Loading-an-Assembly.aspx
That sample does look very interesting. I'll probably go over that today and see if I can get something similar to work. Thanks for the link! I also sent an email to the person Mark Wisecarver recommended. I'll post a solution here when I find it. Hopefully more people on this forum can benefit
I know it's been a while, but here is the solution I found: Place all your images, sounds, and other content into a "Silverlight Class Library." Then you can load your resources from the .dll into your silverlight app. Here is the source code and example: http://www.silverlightexamples.net/post/Load-Bitmap-Image-From-Resource-in-a-Single-Line-of-Code.aspx Hope this helps!
Nice find - it's definitely a useful approach to enable easy loading of resources in an SL assembly but I struggle to see how it solves the original problem associated with a very large XAP. When I look at the sample code, the class library is packaged into the XAP and if this assembly includes lots of resources with their 'Build Action' specified as Resource, the result will be another huge XAP. Mike Taulty's suggested approach side steps and solves this problem by maintaining large resources on the server and enabling the SL application to download them on demand as necessary in small bit size chunks. Maybe I missed something?
That's also what I'm doing. I have a thousand MBytes of .jpg files stored on my Website and download them upon demand. I also have about 70 screenshots of my application, each in an individual .png file that is downloaded upon demand. I basically have no data imbedded in my xap file. It is still 885 KBytes. Be curious to find out if anyone finds my Silverlight application a nuisance to download: http://www.PowerPhotoTools.com