This project is read-only.

Can't get LESS to work

Feb 10, 2013 at 5:07 PM
Edited Feb 10, 2013 at 5:08 PM
I've installed and enabled DotLess module and uncommenced
Style.Include("Less/bootstrapless.less") in Layout

But its throwing
500 Internal Server Error - http://www.mysite.tld/Themes/Bootstrap/styles/Less/bootstrapless.less
without any additional info. What am I missing? Running on .NET 4.5, Orchard 1.6
Feb 10, 2013 at 5:27 PM
Hi Xeevis,

LESS can be very temperamental. Make sure that you have commented out bootstrap.css in Layout.cshtml so that you only have one implementation of the style running.
Also, make sure that you didn't remove or change the web.config file that is in the Less directory: it's specifically designed to allow .less files to be read.

Once you've done all that, restart the application pool on your site so that everything gets cleared out and reset.

Just as an FYI, I stopped using LESS on my other projects. It's definitely an interesting technology, but I'm not sure it's the best solution for use with Orchard at this point. I may come back to it at a later date...especially if the Orchard team decides to support it natively without using an external module.

Good luck!
Feb 14, 2013 at 12:06 AM
Tried everything its not gonna work :). Possibly the DotLess module is broken or outdated or something. I'll stick to CSS for time being then, its not much of an improvement anyway. Thanks for exhausting reply.
Feb 16, 2013 at 10:03 PM
Edited Feb 16, 2013 at 10:03 PM
Finally figured what was wrong ... There is inheritance conflict in StaticFile handlers in Themes/Bootstrap/Styles/web.config and Themes/Bootstrap/Styles/Less/web.config as they are both declaring StaticFile handlers thus server was complaining about duplicate and it was masked with "<httpErrors existingResponse="PassThrough" />" in root web.config. After commenting it I got the exact error and then I removed ones in /Less/web.config and now it works.
Feb 18, 2013 at 4:12 PM
Good to know...thanks for posting the solution. The web.config in the Less folder was created because by default there wasn't a handler for static files with a .less extension. I'll double check the files, but the web.config in the Styles shouldn't have had a handler for .less files...that's why I added one in the Less folder. It might be a good idea in the next release to modify the web.config in the Styles folder, adding the static file handler there, and removing the web.config from the Less folder.

Thanks for the update.
Feb 18, 2013 at 4:14 PM
Also...if you are going to use LESS, I would suggest updating the dotless.Core.dll file from the DotLESS module. It's a bit outdated and there have been some fixes in the newer release that help with things like gradients.
Jul 24, 2013 at 8:04 PM
Tanks for posting the fix, would never have found it my self. Is there any way we can get this fixed in the module on the gallery?
Jul 24, 2013 at 8:32 PM
I updated the Bootstrap theme in the Gallery and I've moved the source control over to GitHub:

The updated module doesn't include LESS anymore because the dotless module is stuck at v1.3.1 which doesn't support the bulk of the Bootstrap LESS files. Bootstrap is now written against v1.4 of LESS. Because of this, I removed LESS support and went back to standard CSS. If they decide to update dotless to v1.4 or v1.4.1, of LESS, I'll look at adding it back in and updating the gallery again. Check out the updated theme and let me know what you think though.