From powershell
Set-Alias msbuild C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
and running from the same directory as my sln file
> msbuild /nologo /property:DefineConstants=FOO
works just fine. Let's say I need two build time constants though.
> msbuild /nologo /property:DefineConstants=FOO;BAR
Powershell interprets the semi-colon as an end-of-statement and runs with a single constant and then tries to run the command BAR
and errors. So not what I want.
How about?
> msbuild /nologo /property:DefineConstants="FOO;BAR"
MSBUILD : error MSB1006: Property is not valid.
Switch: BAR
This doesn't work either. Not sure what's going on here but it seems to be interpreting "FOO;BAR" as some sort of single thing - not two constants.
So. How do I actually pass in multiple constants?
Edit Upon further investigation, I'm running the following in cmd.exe
>C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /property:DefineConstants=FOO;BAR
MSBUILD : error MSB1006: Property is not valid.
Switch: BAR
although this works
>C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /property:DefineConstants="FOO;BAR"