Search code examples
lessdotlessvisual-studio-2013

Dotless HttpHandler with VS2013 Preview


I have just installed the Visual Studio 2013 preview and run up my site. I've noticed that the less files which are used in my site are not being correctly transformed to css and are coming down as blank CSS files.

It appears something is going wrong inside the dotless httphandler as when I force minification for the bundle everything works correctly.

web.config

<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
...
<httpHandlers>
  <add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
</httpHandlers>
...
<handlers>
      <add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
</handlers>

The issue appears to go away if I force minification eg. System.Web.Optimization.BundleTable.EnableOptimizations = false; which suggests something is different in the way it processes the HTTP handler


Solution

  • Try putting handleWebCompression="false" in the configuration for dotless (in the web config)

      <dotless minifyCss="false" cache="true" web="false" handleWebCompression="false" />