Configuring IIS for Silverlight Applications

silverlightYou 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

Adding 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.

Shrinking the Transaction Log in SQL Server 2005

  • Use the MS SQL Server Management Studio

EXEC sp_dboption 'XXX', 'trunc. log on chkpt.', 'TRUE'
CHECKPOINT
DBCC SHRINKFILE ('XXX_Log', TRUNCATEONLY)
EXEC sp_dboption 'XXX', 'trunc. log on chkpt.', 'FALSE'
GO

  • (replace XXX with the database name)

P2V Hyper-v Migration

Tonight I did a bigger P2V (physical 2 virtual) migration. I virtualized an older Windows Server 2003 SP1 with MS SQL Server 2005 and WSS 3.0. This can be used as a step by step how-to guide.

  • First I created a Image of the old server with Symantec Backup Exec System Recovery 2010, this could be done online. I just stopped all the Sharepoint, SQL and Web Services so that no new data could be written in the time I created this Image.
  • After I moved this Image to the Microsoft Hyper-V Host Server, I started to convert the v2i Image with Symantec Backup Exec System Recovery 2010 to a Microsoft VHD.
  • I created a new Virtual Machine on the Hyper-V Server and added this existing VHD. (Important here: I tried to create the same Hardware environment for the VM which I had as physical Hardware before. (Dual Core with 2048MB memory) So I had basically no problem to start the Virtual Machine.
  • Now its time to install the Hyper-v integration components (the VM Drivers) which can only be installed on Windows Server 2003 with SP2 or later. I turned off the Virtual Machine again and attached the VHD File offline on my Hyper-v Server, so I had file access to the Virtual Hard Disk. I simply added the Servicepack 2 file to the root of the VHD.
  • After unmounting the VHD, I started my Virtual Machine again and installed the Servicepack 2 and the Hyper-v Integration components.
  • Now I added more Hardware to the Virtual Machine (Quad-Core and 4GB memory). I also change the Legacy Network Adapters to normal Network Adapters (higher Network performance)

The performance of the new Hyper-v is just pretty impressive.