Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio - dotless.compiler

I need from file ".less" create ".css" file with standart CSS logic before build.

I tried drop dotless.compiler.exe at folder and at Pre-Build event call this command

$(SolutionDir)content\folder\dotless.compiler.exe -m 
$(ProjectDir)content\css\site.less $(ProjectDir)content\css\site.css

but get exception "command exited with code 3". Where am I wrong? Can you offer another way?

like image 820
Mess Avatar asked Dec 21 '25 05:12

Mess


2 Answers

I've found two common instances where I've received that error code when using the dotless compiler in a prebuild event. The first is if the css files already exist within source control and are locked. The second is when a space (or special character) exists in the file paths to the .less or .css files

This can be fixed by deleting the css file prior to running the compile, and putting all filepaths in quotes:

del "$(ProjectDir)content\css\site.css"
"$(SolutionDir)content\folder\dotless.compiler.exe" -m "$(ProjectDir)content\css\site.less" "$(ProjectDir)content\css\site.css"
like image 122
Matt Girolami Avatar answered Dec 22 '25 23:12

Matt Girolami


I was also getting error -3. My problem was that my files were under source control and were locked so the compiler could not overwrite css file. So, your problem might also be that your css file that needs to be overwritten is locked.

like image 37
Nastyface Avatar answered Dec 22 '25 23:12

Nastyface