title: Dotless compiler exited with code -1 - MSBuild
body: <p>I'm trying to use a build script to run the dotless.compiler.exe to compile my .less files into .min.css on build:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003"&gt;
    &lt;!--    
      This MSBuild Script will compile all [*.less] files in the /CSS folder to their [*.min.css] counterparts.
      --&gt;
    &lt;ItemGroup&gt;
      &lt;LessFiles Include="Styles\*.less" /&gt;
    &lt;/ItemGroup&gt;
    &lt;Target Name="CompileDotlessCss" AfterTargets="AfterBuild"&gt;
      &lt;ItemGroup&gt;
        &lt;Binaries Include="*.dll;*.exe"/&gt;
      &lt;/ItemGroup&gt;
  
      &lt;!-- Compile dotLess CSS into minified full CSS --&gt;
      &lt;Exec Command="[MSBuild]\dotless.compiler.exe -m %(LessFiles.FullPath)  $([System.String]::Copy('%(LessFiles.FullPath)').Replace('.less','.min.css'))" /&gt;
  
    &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>But when I build I get:</p>
  
  <pre><code>The command "[MSBuild]\dotless.compiler.exe -m C:\Source Control\MyProject\MyProject.Web\Styles\main.less  C:\Source Control\MyProject\MyProject.Web\Styles\main.min.css" exited with code -1.  
  </code></pre>
  
  <p>I suspect it has to do either with my project being under source control or simply the fact that the file path has a space in the "Source Control" folder. </p>
  
  <p>How can I wrap the path in quotes (since the command itself is in quote)? </p>
  
  <p>If it's the source control factor and it fails because the files are locked (I tried building with the file checked in).. how do I deal with this? I obviously want to keep my project under source control.</p>