Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to get http://www.dotlesscss.org/ installed on sharepoint 2010 server for use for the whole site instead of just an application.

I have installed the dll into the GAC and the bin of the server and made the following web.config updates:

<SharePoint>
    <SafeControls>
        <SafeControl Assembly="dotless.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34" Namespace="dotless.Core" TypeName="*" Safe="True" SafeAgainstScript="False" />
    </SafeControls>
</SharePoint>

<system.web>
    <httpHandlers>
        <add type="dotless.Core.LessCssHttpHandler,dotless.Core" validate="false" path="*.LESS" verb="*" />
    </httpHandlers>
</system.web>

<system.webServer>
    <handlers>
        <add name="dotless" type="dotless.Core.LessCssHttpHandler,dotless.Core" preCondition="integratedMode" path="*.LESS" verb="*" />
    </handlers>
</system.webServer>

When I try to access a .less file (http://myserver.com/lesstest.less) I receive a 404 error with a response body of: /* File Not Found while parsing: Could not find file 'C:\inetpub\_wwwroot\wss\VirtualDirectories\WWW80\lesstest.LESS'. */

This error seems to come from: https://github.com/dotless/dotless/blob/master/src/dotless.AspNet/LessCssHttpHandler.cs

Does anyone have any insight as to what may be my problem?

Thanks!

share|improve this question

1 Answer 1

My assumption by your error is that your .LESS file is in the SharePoint Content Database rather than on the hard drive. In order for the .LESS files IN SharePoint to run through the handler, you would need to rework the Less Handler to integrate a bit with SharePoint.

HOWEVER, if you put the .LESS files on the server hard drive, the handler will be able to find them. In Visual Studio, you could create a simple SharePoint solution that puts your .LESS files in the _LAYOUTS folder...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.