Wednesday, June 20, 2012

Visual Studio & IIS Express : Add static content mime types like ".WebM"

I took over a project the other day which had cause to use video in WebM format. Cassini (bless it) flatly refused to do anything at all with the file and one of the requirements was to take some action after the video finished playing. Not wanting to code this "blind" I decided it was about time to upgrade to IIS Express (I already had Visual Studio sp1 installed but not from the Web Platform Installer). I went off and downloaded the executable and followed the following instructions to set it up.

IIS Express Download:
http://www.microsoft.com/en-us/download/details.aspx?id=1038

Installation and Setup Instructions:
http://blogs.msdn.com/b/webdevtools/archive/2011/03/14/enabling-iis-express-support-in-vs-2010-sp1.aspx

WebM File Format Details (See naming section):
http://www.webmproject.org/code/specs/container/

Once this was completed I simply had to navigate to the installation directory and run the following command and presto everything worked! My advice, drop Cassini and use IIS Express immediately!

Installation directory:

C:\Program Files (x86)\IIS Express

Command to enabled WebM:
appcmd set config /section:staticContent /+[fileExtension='.webm',mimeType='video/webm']
Read More