I need to build a solution from the command line using msbuild with one of the arguments taking an environment variable as part of the argument, however the variable is not expanding when it is executed.
The command line I am using is
c:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo "c:\b\sources\mysolution.sln" /m:1 /p:SkipInvalidConfigurations=true /p:VCBuildToolPath="$(VS80COMNTOOLS)....\VC\VCPACKAGES" /p:OutDit="C:\b\binaries\" /p:Configuration="RELEASE" /p:Platform="Mixed Platforms" /p:VCBuildOverride="C:\b\sources\mysolution.sln.mixed platforms.Release.vsprops"
and the error I receive is MSB6004: The specified task executable location "$(VS80COMNTOOLS)....\VC\VCPACKAGES\VCBuild.exe" is invalid. [c:\b\sources\mysolution.sln]
I have tried using double double quotes around the VCBuildToolPath argument, and using %VS80COMNTOOLS%, but the environment variable is never expanded.
According to the system VS80COMNTOOLS is set as c:\Program Files\Microsoft Visual Studio 8\Common7\Tools
Please could you tell me the syntax for using an environment variable in a command line argument in this way.
P.S. I do not what to have to revert to using an msbuild project file for this as I have a large number of solutions to which I need to apply this command line argument, across a number of build definitions all being triggered and built through TFS.