In a .NET 4 MVC3 project I'm running a local machine on IIS6 (don't ask why). It has a proper wildcard mapping in IIS to the v4 aspnet_isapi.dll, and the same goes for the .less extension.
Web.config has these IIS6 and IIS7 httphandlers defined.
<system.web>
<httpHandlers>
<add type="dotless.Core.LessCssHttpHandler,dotless.Core" validate="false" path="*.less" verb="*" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<add name="less" type="dotless.Core.LessCssHttpHandler,dotless.Core" path="*.less" verb="*" />
</handlers>
</system.webServer>
Surfing to /path/to/nonexisting.less
throws a proper error which shows me a stacktrace that the LessCssHttpHandler is in action.
Surfing to /path/to/existingfileondisk.less
just downloads the original less file as is. To me it seems that an existing static file handler is in action here, though I'm not sure.
What am I missing (apart from new machine ;))?
I also encountered this problem, and next solution fixed the problem:
If you are using IIS 6 or earlier or are not using IIS's integrated pipeline, you'll need to configure your web server's settings so that requests for .LESS files are routed to the ASP.NET engine (so that they can be processed by the .LESS HTTP Handler). For more details read How ASP.NET Web Pages are Processed on the Web Server
Steps how to configure IIS6:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With