1

I am following the instructions for using .less to minify the css.

I have included the dll and made the Web.config changes.

However, when I refer to it in index.cshtml as Less.Parse, the Less namespace is not available and I get the exception "The name Less does not exist in the current context."

What am I missing?

CarenRose
  • 1,266
  • 1
  • 12
  • 24
mmssaann
  • 1,507
  • 6
  • 27
  • 55

2 Answers2

2

I have solved it. It was just missing the parent namespace. Now conversion works like a charm.

dotless.Core.Less.Parse(css)
CarenRose
  • 1,266
  • 1
  • 12
  • 24
mmssaann
  • 1,507
  • 6
  • 27
  • 55
1

If you are using Visual Studio, Web Essentials has support for less.

http://vswebessentials.com/features/less

I often use it for :

  • .less to .css preview
  • View output from a .less compile
  • Extract variables/mixins

After build if you go to Output and select Web Essentials from the 'Show output from:' dropdown, you will see a date, time and the list of .less files that have compiled.

hutchonoid
  • 32,982
  • 15
  • 99
  • 104
  • I am not using web essentials. Basically I get css as string from data base, I need to parse that using dotless before I put it into the web page in style tag. For that I am not able to use Less namespace to parse the string into normal css. Any ideas?? – mmssaann Jan 17 '14 at 04:39