Missing .Less Files with Visual Studio 2010 Deployment Package

Recently, I deployed a Visual Studio 2010 web site and was perplexed by the omission of my .less files from the deployment package. What stumped me was my other projects (in VS2012) deployed .less files without any issues.

The solution is to mark the file’s Build Action as Content in the file Properties in Visual Studio. By default Visual Studio 2010 does not recognize .less files.

  1. View → Solution Explorer
  2. Right-click on the .less file → Properties
  3. Change Build Action to Content

file properties

Visual Studio 2012 does not have this problem. One of the common web tools plugins probably accounts for .less files.