http://www.shahed.net/post/Hosting-Silverlight-20-in-IIS.aspx
If you host Silverlight 2.0 application in IIS you might find that the silverlight object is not loading. If that’s the case, first thing you should check is the MIME type list. By default, the Silverlight package extension *.xap is not included.
To resolve that, go to IIS Manager, properties of your web site and check the “Http Headers” tab.

Then click the MIME Types button. You should see a list as bellow.

If the .xap extension is not in the list then click New… and add the following entry:
Extension: .xap
MIME type: application/x-silverlight-app
Now, check your site. You should get the silverlight objects properly.
http://weblogs.asp.net/mschwarz/archive/2008/03/07/silverlight-2-not-working-on-production-web-server.aspx
Silverlight 2 not working on Production Web Server
I got some questions about why is Silverlight 2 beta not working on my production Web server? Well, one of the most errors I found is the missing MIME type definition in IIS. Silverlight 2 doesn’t compile a DLL as the beta 1.1 did. The new file extension is .XAP. The only thing you have to do is following step:
- Open the Internet Information Services Manager (IIS Manager)
- Right-click on IIS and select Properties
- Click on the MIME-Types button
- Click on New… to add a new MIME-Type
- For file extension use .XAP and for the MIME-Type use Assembly application/x-silverlight
(don’t miss the dot before XAP!!)
Now you are able to run your Silverlight 2 apps.

If you cannot modify the MIME type you can simple rename the ClientBin file to .DLL. Note that you have to modify the source param, too.
Update: If you are using IIS7 yu can run following command. This will change the applicationHost.config in the subfolder config (section <staticContent/>):
“%systemroot%\System32\inetsrv\appcmd” set config /section:staticContent /+[fileExtension='.xap',mimeType='application/x-silverlight']
http://learn.iis.net/page.aspx/262/silverlight/
RSS
function incrementAndPrint() { new Ajax.Request(‘/js/HelpfulHandler.ashx?command=print’, { method:’post’, parameters: Form.serialize(‘aspnetForm’), onSuccess: null, // function(transport){alert(transport.responseText);}, onFailure: function(){ alert(‘Something went wrong…’) } }); window.print(); } function sentEmail() { new Ajax.Request(‘/js/HelpfulHandler.ashx?command=emailed’, { method:’post’, parameters: Form.serialize(‘aspnetForm’), onSuccess: null, // function(transport){alert(transport.responseText);}, onFailure: function(){ alert(‘Something went wrong…’) } }); }
Featured IIS 7.0 Web Hosting
Windows 2008/IIS 7.0 Hosting is Here!
- Starting at $10/mo
- Windows 2008 Servers w/ IIS7
- Access to Microsoft IIS7 Manager
- Trust Level Control
- Pipeline Mode Selector Tool
- ASP.NET 3.5/2.0
- LINQ, AJAX, PHP5
Get 3 Months Free of IIS 7 Hosting Now

advertise here
Introduction
Microsoft® SilverlightTM is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows.
In most cases, hosters do not need to perform particular deployments to support Silverlight. However, check for the following basic items that could prevent Silverlight from functioning correctly.
MIME Types
In Windows Server 2008 IIS 7.0
All MIME types needed to support Silverlight are implemented by default in Windows Server 2008 IIS 7.0 and Windows Vista SP1. Windows Vista RTM customers can add mime types by running “IIS Manager”, clicking on “Mime Types”, then clicking “add” and adding the following mime types:
- .xap application/x-silverlight-app
- .xaml application/xaml+xml
- .xbap application/x-ms-xbap

Alternatively, you can add the following mime types to your %windir%\system32\inetsrv\config\applicationHost.config file in the <staticContent> section.
<mimeMap fileExtension=”.xaml” mimeType=”application/xaml+xml” />
<mimeMap fileExtension=”.xap” mimeType=”application/x-silverlight-app” />
<mimeMap fileExtension=”.xbap” mimeType=”application/x-ms-xbap” />
In Windows Server 2003 IIS 6.0
To enable IIS 6.0 in Windows Server 2003 or IIS7 in Windows Vista RTM with the appropriate MIME Types, add:
- .xap application/x-silverlight-app
- .xaml application/xaml+xml
- .xbap application/x-ms-xbap
Here is a VBS script you could run to enable each of these types:
Const ADS_PROPERTY_UPDATE = 2
‘
if WScript.Arguments.Count < 2 then
WScript.Echo “Usage: ” + WScript.ScriptName + ” extension mimetype”
WScript.Quit
end if
‘
‘Get the mimemap object.
Set MimeMapObj = GetObject(“IIS://LocalHost/MimeMap”)
‘
‘Get the mappings from the MimeMap property.
aMimeMap = MimeMapObj.GetEx(“MimeMap”)
‘
‘ Add a new mapping.
i = UBound(aMimeMap) + 1
Redim Preserve aMimeMap(i)
Set aMimeMap(i) = CreateObject(“MimeMap”)
aMimeMap(i).Extension = WScript.Arguments(0)
aMimeMap(i).MimeType = WScript.Arguments(1)
MimeMapObj.PutEx ADS_PROPERTY_UPDATE, “MimeMap”, aMimeMap
MimeMapObj.SetInfo
‘
WScript.Echo “MimeMap successfully added: ”
WScript.Echo “ Extension: ” + WScript.Arguments(0)
WScript.Echo “ Type: ” + WScript.Arguments(1)
If you copy and paste the code above into a VBS file and save it as ADDMIMETYPE.VBS the syntax to add each type would be:
ADDMIMETYPE.VBS .xap application/x-silverlight-app ADDMIMETYPE.VBS .xaml application/xaml+xmlADDMIMETYPE.VBS .xbap application/x-ms-xbap
Using the IIS Manager User Interface in Windows Server 2003 IIS 6.0
1. Go to Start\Administrative Tools and run IIS Manager, see figure below:

2. Right click on the server name and select “Properties”, see figure below:

3. In the Properties Dialog, click on the “MIME Types” button, see figure below:

4. In the “MIME Types” Dialog, click the “New” button, see figure below:

5. In the “MIME Type” Dialog enter one MIME Type at the time:
.xap application/x-silverlight-app
.xaml application/xaml+xml
.xbap application/x-ms-xbap
see figure below:

For detailed information on Silverlight, visit http://silverlight.net/.
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]