You can simply add Silverlight support to your IIS6 webserver running on Windows Server 2003.
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
Tags: .xaml, .xap, .xbab, IIS, IIS Manager, IIS Silverlight, IIS6, Microsoft, mime, mime types, silverlight, silverlight 3, webserver, Windows Server, Windows Server 2003 Last modified: July 5, 2019Adding MIME Types by a simple VB script:
- 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
or you could add it very simple over the IIS Manager.
I got an “Invalid Sytax” from GetObject(“IIS://LocalHost/MimeMap”) when running on 2008 server
I got an “Invalid Sytax” from GetObject(“IIS://LocalHost/MimeMap”) when running on 2008 server
This is how you setup IIS 6 to run .Net 4.0 as the default framework and support Silverlight 4.0.
Run:
C:WindowsMicrosoft.NETFramework1033aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv1.0.3705aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv1.1.4322aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv2.0.50215aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv3.0aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv3.5aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_regiis.exe -i
A few of the CMD’s may return an error file not found.
You also have to add the MIME types for Silverlight:
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap
A new site will be created as .Net 4.0 default and update all current websites to .Net 4.0 as the default framework. IIS 6 configuration mappings will show 4.0.
Please share with your readers. This is a 100% will work solution.
This is how you setup IIS 6 to run .Net 4.0 as the default framework and support Silverlight 4.0.
Run:
C:\Windows\Microsoft.NET\Framework\1033\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v1.0.3705\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v2.0.50215\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v3.0\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v3.5\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
A few of the CMD’s may return an error file not found.
You also have to add the MIME types for Silverlight:
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap
A new site will be created as .Net 4.0 default and update all current websites to .Net 4.0 as the default framework. IIS 6 configuration mappings will show 4.0.
Please share with your readers. This is a 100% will work solution.