I'm currently building my LESS files using lessc.wsf which you can download here: https://github.com/duncansmart/less.js-windows/tree/windows-script-host
Then in your Worker Role you can do something like this:
// File path.
var lessCompilerPath = "...\\lessc.wsf";
var lessPath = "site.less");
var cssPath = "site.css");
// Compile.
var process = new Process
{
StartInfo = new ProcessStartInfo("cscript")
{
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
Arguments = "//nologo \"" + lessCompilerPath + "\" \"" + lessPath + "\" \"" + cssPath + "\" -filenames",
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
}
};
process.Start();
process.WaitForExit();
// Error.
if (process.ExitCode != 0)
{
throw new InvalidOperationException(process.StandardError.ReadToEnd());
}
You'll need to match the path to your files depending on where they are located in your solution.