I'm using cmd
from Shake and having trouble forming the following command line ...
msbuild a.sln /p:Configuration=Debug /p:Platform="Any CPU"
When I try escaping the double quote, the escaping and string quoting flows too far and get this error ...
Development.Shake.cmd, system command failed
Command: msbuild a.sln /p:Configuration=Debug "/p:Platform=\"Any CPU\""
Exit code: 1
I've tried 3 ways ...
cmd "msbuild a.sln /p:Configuration=Debug /p:Platform=\"Any CPU\""
cmd "msbuild a.sln /p:Configuration=Debug" ["/p:Platform=\"Any CPU\""]
cmd "msbuild" ["a.sln", "/p:Configuration=Debug", "/p:Platform=\"Any CPU\""]
I am running this on Windows.
I wrote a little C program (which I named
msbuild
) to test:Using that I tested your variants:
The one that fixes this is to use the
Shell
command, to tell Shake to avoid doing any of its own escaping:However, assuming the real
msbuild
is like the other Visual Studio tools (e.g.fsc
,csc
,cl
), you can probably use the equivalent (and perhaps preferred) variant of:Which you can express with Shake as: