问题
I am following the link https://github.com/dotless/dotless/wiki/Using-.less to minify the css. I have include the dll and made Web.config changes.
However when the refer it in index.cshtml as Less.Parse , the Less namespace is not available and and getting the exception "The name Less does not exists in the current context"..
can somebody advise what am I missing?
回答1:
I have solved it.. just missing parent name space and conversion works like a charm
dotless.Core.Less.Parse(css)
回答2:
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.
来源:https://stackoverflow.com/questions/21162836/unable-to-use-less-parse-using-dotless-in-c-sharp