It will generate a "XAP" file called " XapContent.xap".
"XapContent" is also a Silverlight project.The " XapLoader.xap" file will be hosted in the "XapWebHost" web application. It will generate a "XAP" file called " XapLoader.xap". "XapWebHost" is an ASP.NET web application to host the Silverlight application.This example Visual Studio solution has three projects: If you are new to Silverlight, Scott Guthrie's blog is the default place for you to get started.
This article assumes the readers having some basic experiences with Silverlight development. The Visual Studio solution that comes with this article is developed in Visual Studio 2010 and Silverlight 4. This article introduces a method to download and use "XAP" packages on demand in Silverlight with a Visual Studio example.
Silverlight download file code#
If I un-comment whatever code I commented, the file shows 524194 bytes and the download stops working. However, when I try to download the 30MB file, the download starts successfully.įor example, using directory browsing, the file shows 523587 bytes in length. So I placed a 30MB file in the same directory as the XAP file. I already tried registering MIME types in IIS (and double and triple checking I was writing the entries correctly), double and triple checking that the XAP file address was correct, tried changing the XAP extension to ZIP, and reinstalling Silverlight 4 Tools for VS.NET 2010.Īt some time I thought it might be something about the XAP file size, which sits at 512K working or not. If I un-comment the code, the log-in stops working again and I cannot download the XAP file anymore. Tweaking the source code I noticed that, if I comment some code (any code at random, no code specifically, as long as no compile time error shows up), the application starts showing the log-in page correctly and I can download the XAP file correctly again. With this information I browsed my virtual directory using the browser and tried downloading the file with a right-click/save-as, but the browser just hanged waiting for a response from the server. Using Fiddler I noticed that the browser makes the request to the correct file, but it looked like the server either hangs or did not respond with the file stream. If I right-clicked on the blank area, the usual Silverlight context menu showed up and I could see the settings. Last Thursday, VS.NET stopped debugging my application and the area where Silverlight was supposed to show was being left blank and there were no java errors shown by Internet Explorer 8. Everything was working 100% perfectly, even without registering MIME Types in IIS. I'm developing a Silverlight 4 application.
My development laptop is WinXP with IIS 5.1. I did find several questions with the same problem I'm having, but none of the solutions have worked for me. Unfortunately, none of the questions addressed my problem, nor did any of my searches worked. The feature that shows related questions WHILE making the questions is very nice.