If you are working with Sliverlight application (VS2008 and Silverlight on WindowsXP) and getting the error# 2104 as shown in the figure below, then here are some of the trick which will work for you to resolve the issue:

Before trying any major changes in IIS(inetmgr), go to the solution explorer and open ClientBin folder, in which you will see a file created having name of your application and suffixed with a .xap extension, eg- SilverlightApplication.xap.

Now go to your aspx page which is calling the Page.xaml, in most of the cases if unchanged it will be SilverlightAppliacationTestPage.aspx, open this page (Source view) and you will find that source element is set to:
ClientBin/SilverlightApplication.page

If you observe here the file referred is filename.page which is a default setting, whereas the ClientBin folder have filename.xap, so change the extension of file for source element to .xap

It may help you to get rid of the error. If not…

Lets try some IIS setting changes:

1. Content Expiration Setting

By defalut its not enabled, so enable this:

Step-1: Right-click your Web Site, select Properties from the context menu.
Step-2:Go to HTTP Headers tab and click “Enable Content Expiration”.
Step-3:Set the content to expire after 1 minute.

2. Let IIS know about MIME Types and File Extensions

To enable a Silverlight application under your IIS, you need to register some MIME types and file extensions so that the browser on the client’s system can load the correct handler.

Step-1: Right-click your Web Site, select Properties from the context menu.
Step-2:Go to HTTP Headers tab and click on “File Types” under Mime Map section.

You need to add the following types:
——————————————
Extension —– MIME Type
——————————————
.xap ———– application/octet-stream
.xaml ———- application/xaml+xml
——————————————

3. Change Execute permissions to Scripts Only.

Step-1: Right-click your Web Site and select Properties from the context menu.
Step-2:Select the Directory tab and change “Execute Permissions” to Script only.

Once these settings are done, retry running your app, it will work for you.

If you have installed Microsoft Silverlight Tools Beta 2 for Visual Studio 2008, then you might be facing probelm while designer page is loading and it might be throwing an exception as well.

The resolution to this is to un-install the Silverlight Tools Beta-2, and install the newly released 10/20/2008 Add-on for Visual Studio 2008 SP1 for developing Silverlight 2 application.

Silverlight Tools for VS 2008

Once this update is done, you will be able to find clean designer slate, and there will be no exception/errors/warnings while Silverlight page is loading in the IDE.