1

My problem is am unable to compile .less files to .css using dotless in production server. I installed the dotless package using Nuget in Visual Studio 2010. Its working fine locally. No css file is generated.

When i see the view source, i see the following in the head section of the page:-

<link href="/MyProjectFolder/Content/styles?v=" rel="stylesheet">

and there is no content displayed when i click on this above link as the file is not generated.

Can anyone help me in resolving this issue.

Update 1: Mentioned the approach by which am calling the less files

Am using the bundling of less files by using the following code in the BundleConfig.cs file as:-

bundles.Add(new StyleBundle("~/Content/common").Include("~/Content/common.less"));

and in my html page in the head section I call it using

@Styles.Render("~/Content/common")

My common.less file also has reference to two other files, using import. So the common.less file would like:-

@import "variables.less";
@import url(http://fonts.googleapis.com/css?family=Roboto);

body{
 background-color: @body-bg;
}

..and so on

2
  • Can you explain a bit more how you are using dotless. Are you referencing the less file directly in the page? Or are you using bundling? If so how? Commented Oct 28, 2014 at 10:06
  • Colin I am using the bundling approach to reference the less file. I have updated my question to show the code. Commented Oct 28, 2014 at 10:40

2 Answers 2

1

It doesn't look like you are adding a bundle transformer to compile the LESS files.

Please see the documentation here under "LESS, CoffeeScript, SCSS, Sass Bundling."

Sign up to request clarification or add additional context in comments.

Comments

1

Another way to solve this is to remove dependency on dotLess and use free Visual Studio Extension https://github.com/madskristensen/WebCompiler for precompilation of less to css (with and without minification).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.