I need to run MSBuild from the command line using the Visual Studio Command Prompt (2010). It used to work fine. Now when I open the window I get the following error message:
\Common was unexpected at this time.
Trying to run the msbuild
command after that fails.
I naturally assumed it was an issue with an unquoted entry in my PATH environment variable, possibly from a recent rogue install. I checked that, but the PATH seems to be kosher.
Digging into the file system, I discovered that the batch file being run by the prompt is C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat. I edited that by putting in ECHO
statements to trace the location of the error. That seemed to point to an error at this line:
@if not "%WindowsSdkDir%" == "" (
If I remove the quotation marks, the error is different: "Files was not expected at this time."
The next 2 lines after this are now:
@echo 51
@set "PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools;%WindowsSdkDir%bin;%PATH%"
I assumed the failing statement was the second line, but the echo
statement doesn't produce any output, so I don't know how that could be happening.
I am using a 64-bit version of Windows 7.
I would appreciate any help at all.