How do i use DotLess in a Windows Azure project?

701 views
Skip to first unread message

Not My Full Name

unread,
Jul 27, 2010, 9:28:49 AM7/27/10
to DotLess (Less Css for .NET)
When i run the project as a local MvcWebApp i works great, but when I
try to build it as an Azure Cloud project, DotLess does not work (or
I'm not able to get it to work). Tried to download the source and
compile it on my own machine but nothing happened when i ran the build
script.

Not My Full Name

unread,
Jul 27, 2010, 9:31:17 AM7/27/10
to DotLess (Less Css for .NET)
Btw: windows azure is a 64 bit operating system, I guess this might be
somewhat relevant.

Jonathan De Jong

unread,
Jul 27, 2010, 9:55:01 AM7/27/10
to dot...@googlegroups.com
Can you post the httpHandlers section from the system.web section of your web.config. As well as the handlers section of the system.webServer.
 
Most likely that is where your issue is.

Not My Full Name

unread,
Jul 27, 2010, 11:29:37 AM7/27/10
to DotLess (Less Css for .NET)
Sorry if I am spamming you here but for some reason i cannot see my
last attempts at replying.

web.config sections: http://pastebin.com/CRhdT3sj

On 27 Jul, 15:55, Jonathan De Jong <jdblueaud...@gmail.com> wrote:
> Can you post the httpHandlers section from the system.web section of your
> web.config. As well as the handlers section of the system.webServer.
>
> Most likely that is where your issue is.
>

Not My Full Name

unread,
Jul 27, 2010, 10:01:33 AM7/27/10
to DotLess (Less Css for .NET)
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add verb="*" path="*.mvc" validate="false"
type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add type="dotless.Core.LessCssHttpHandler,dotless.Core"
validate="false" path="*.LESS" verb="*" />
</httpHandlers>

<system.webServer>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<remove name="MvcHttpHandler"/>
<remove name="UrlRoutingHandler"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode"
verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*"
path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*"
path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</handlers>
</system.webServer>


On Jul 27, 3:55 pm, Jonathan De Jong <jdblueaud...@gmail.com> wrote:
> Can you post the httpHandlers section from the system.web section of your
> web.config. As well as the handlers section of the system.webServer.
>
> Most likely that is where your issue is.
>

Not My Full Name

unread,
Jul 27, 2010, 10:08:49 AM7/27/10
to DotLess (Less Css for .NET)
from the web.config:
> Can you post the httpHandlers section from the system.web section of your
> web.config. As well as the handlers section of the system.webServer.
>
> Most likely that is where your issue is.
>

Not My Full Name

unread,
Jul 27, 2010, 11:21:33 AM7/27/10
to DotLess (Less Css for .NET)
http://pastebin.com/CRhdT3sj

On Jul 27, 3:55 pm, Jonathan De Jong <jdblueaud...@gmail.com> wrote:
> Can you post the httpHandlers section from the system.web section of your
> web.config. As well as the handlers section of the system.webServer.
>
> Most likely that is where your issue is.
>

Jonathan De Jong

unread,
Jul 27, 2010, 11:54:43 AM7/27/10
to dot...@googlegroups.com
Add the following to the <system.webServer><Handlers>
 
<add name="DotLess" preCondition="integratedMode" type="dotless.Core.LessCssHttpHandler,dotless.Core" path="*.LESS" verb="*" />
 
Try that and let me know if it helps.
 
-JD

Daniel Hölbling

unread,
Jul 27, 2010, 11:56:45 AM7/27/10
to dot...@googlegroups.com
Sorry, Google Groups decided you need to be moderated that's why your responses took a second to show up. .. 

Not My Full Name

unread,
Jul 28, 2010, 4:47:07 AM7/28/10
to DotLess (Less Css for .NET)
Still not working when i run the project as an azure cloud
application. 0 errors 0 warnings. When I try to access the .less files
i get a 404 file not found error.

Everything still works fine when I only run the project in non-azure
mode.

On Jul 27, 5:54 pm, Jonathan De Jong <jdblueaud...@gmail.com> wrote:
> Add the following to the <system.webServer><Handlers>
>
> <add name="DotLess" preCondition="integratedMode"
> type="dotless.Core.LessCssHttpHandler,dotless.Core" path="*.LESS" verb="*"
> />
>
> Try that and let me know if it helps.
>
> -JD
>

Not My Full Name

unread,
Aug 4, 2010, 6:31:01 AM8/4/10
to DotLess (Less Css for .NET)
Just a small update here, I took another look at this today and
finally got it to work. Windows Azure is using IIS 7, so as Jonathan
pointed out I had to edit my settings in the
<system.WebServer><Handlers> section of my web.config

I still got a 404 not found error when I tried to access the .less
files, renaming them to .less.css made them accessible, and editing
the path to ".LESS.CSS" made dotless modify the files.

Daniel Hölbling

unread,
Aug 4, 2010, 7:13:22 AM8/4/10
to dot...@googlegroups.com
Cool, it would be nice if you could compile a guide on how to use dotless on Azure so we can put that up on our website, or if you blog link to it from the website..

greetings Daniel

Jonathan De Jong

unread,
Aug 4, 2010, 7:52:17 AM8/4/10
to dot...@googlegroups.com
This is most likely because you would need to register .less as a type in IIS7. Adding the handler does not necessarily tell IIS to pass that MIME type to .Net.

puhf...@gmail.com

unread,
Sep 14, 2012, 11:36:55 AM9/14/12
to dot...@googlegroups.com
Setting the LESS files to a build action of "Content" is all you need to do to fix thsi problem.

Right click all your LESS files, select PROPERTIES, change Build Action to "Content". Problem solved! :)
Reply all
Reply to author
Forward
0 new messages