Subtle Technology

A blog about Microsoft .NET, Ext JS, Silverlight, FaceBook, Twitter, and other technologies by Michael Urvan

Recent posts

Tags

Categories

Navigation

Pages

Archive

Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Silverlight or Sketchflow error 2104 unable to download the application with IIS

SilverlightLogo Any time you receive a blank web page when trying to view or deploy a Silverlight application to your web server, it is possibly the result of a missing .xap MIME type handler. Occasionally it has to do with file permissions, if you just created a new web site and directory. Back in early 2008 when I first started working with Silverlight, it was difficult to find information about why the Silverlight app wouldn't display. If I remember correctly, Visual Studio at that time did not generate the Javascript code in the HTML app page to bubble up the error in Silverlight 2 so there was no indication. The first place that you should check when you have a strange issue with a web page hosted on IIS is to examine the web site access logs. The logs should give you an indication of whether it is file access permissions, authentication problems, or (in this case) missing mime type mappings.

Here in the access log you can see the xap file error:

2009-10-15 08:54:08 W3SVC1512438873 192.1681.1.22 GET /WebAdmin/WebAdmin.xap - 80 - 192.168.1.44 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.14)+Gecko/2009082707+Firefox/3.0.14+(.NET+CLR+3.5.30729) 404 3 50

For IIS, you can find the detailed explanation of IIS HTTP status codes listed here:
http://support.microsoft.com/default.aspx/kb/318380

If you skip to the 404 error in the reference documentation, you will see that 404.3 means "MIME map policy prevents this request"

I describe how to find the error in javascript Internet Explorer below... but in FireFox you would need to use the Tools menu to open the Error Console and scroll to the end to find the javascript error.

When you navigate your web browser to the page in IE, you are greeted with a blank web page and the only indication of a problem (on IE) is the little javascript error icon in the bottom left corner of the browser as seen here:

silverlight error 2104 javascript warning crop

Double clicking on the icon shows the following error:

silverlight error 2104 full warning crop

Right click on the website in IIS select Properties, and click on the HTTP Headers tab:

image

click on MIME Types... click New.. and enter ".xap" for Extension and "application/x-silverlight-app" as the MIME-Type:

image

The older .xaml is for Silverlight 1 and .xbap is for WAML Browser Application for WPF deployments. If you want xbap add a similar entry with "application/x-ms-xbap". For more info on XBAP go here: http://xbap.org/

For anyone hosting on an asp.net web host provider like GoDaddy or DiscountASP, you can configure the mappings yourself in web.config.  Here is an article that has tips on web hosting with Silverlight: http://www.wpflearningexperience.com/?cat=12

This article contains information about setting the mime types using web.config:
http://blogs.iis.net/bills/archive/2008/03/25/how-to-add-mime-types-with-iis7-web-config.aspx

Posted: Oct 15 2009, 23:08 by Michael Urvan | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Silverlight Bookmark and Share

How to list, clear or delete isolated local storage used with Silverlight

Using Isolated Local Storage in Silveright is simple enough, but I was curious about how to clear the local storage...  To delete Silverlight specific local application storage, bring up any Silverlight application and right click on it. The only popup menu option given is 'Silverlight'. Select it, and on the Microsoft Silverlight Configuration dialog, select the Application Storage tab:

image

At this point you can select and delete isolated storage for any Silverlight application you may have used.

The MSDN documenation on the Silverlight Configuration dialog is at http://msdn.microsoft.com/en-us/library/cc645084(VS.95).aspx

For ASP.NET applications and WCF services you use the storeadm.exe Isolated Storage Tool, accessible by using the Visual Studio Command Prompt.

Available command line options are shown in the MSDN documentation as storeadm [/list][/machine][/remove][/roaming][/quiet]

storeadm /list will show you all of the local stores currently on the machine.

storeadm /roaming /remove  will clear the current user's local storage whereas storeadm /machine /remove will clear the machine local storage.

The MSDN documentation is at http://msdn.microsoft.com/en-us/library/ezabwsbk(VS.100).aspx

Posted: Oct 08 2009, 09:35 by Michael Urvan | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Silverlight | WCF Bookmark and Share