17 April, 2010

Sys.InvalidOperationException: InitializeError Error #2104

I started development in silverlight recently. When everything is installed, i just started with a test application and on running the site i got the following exception.

Microsoft JScript runtime error: Sys.InvalidOperationException: InitializeError error #2104 in control 'Xaml1': Could not download the Silverlight application. Check web server settings

I am surprised to see this error as all the required things are installed. But I missed one small thing. That is to add silverlight application MIME type to the web server(IIS). After adding this MIME type, my application run without any error.

Steps to add MIME type in IIS6:
1) Goto the silverlight web application/ website properties.
2) Open HTTP Headers Tab and find MIME types region.
3) Click MIME Type button and add new MIME type
4) Type .xap and application/x-silverlight-app as extension and MIME types respectively.
5) Save your settings. This will add silverlight mime type to the sever, so that our application run without any error.

No comments:

Post a Comment