{ bob.yexley.net }

software development, sports, the outdoors, faith, life...

Using Less CSS With Visual Studio and IIS Express

I recently started working on a personal ASP.NET MVC project on which I wanted to use Less CSS for styling. I quickly ran into a problem when I discovered that a IIS Express doesn’t have “.less” registered as a valid MIME type, so it won’t serve up the file at all. So that forced me to dig around to figure out how to add a mimetype to the IIS Express configuration. I found a working solution, and thought it could potentially help someone else out.

To add the .less extension as a valid MIME type to IIS express follow these steps:

  1. Open a windows command prompt
  2. Switch to the directory that IIS Express is installed in (on my 64 bit Windows 7 system, it was installed in C:\Program Files (x86)\IIS Express)
  3. Execute the following command:
1
appcmd set config /section:staticContent /+[fileExtension='.less',mimeType='text/css']

Boom. Works great. Now I’m rollin’ with Less CSS in my ASP.NET MVC project developing on IIS Express. Sweetness.

Comments