Sometimes msbuild will throw an error like this for an x86 project:
"C:\Users\Developer\Versioned\libssh2\build\libssh2.sln" (default target) (1) ->
(ValidateSolutionConfiguration target) ->
C:\Users\Developer\Versioned\libssh2\build\libssh2.sln.metaproj : error MSB4126: The specified solution configuration "Debug|X64" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties
form="Any CPU") or leave those properties blank to use the default solution configuration. [C:\Users\Developer\Versioned\libssh2\build\libssh2.sln]
Cause:
vsvars64.bat will set the environment variable Platform=x64 but vsvars32.bat will not empty this environment variable.
Easiest is to run set Platform= then run vsvars32.bat.
Adopted from MSBuild creating an x64 solution configuration via sln.metaproj – Stack Overflow [WayBack]:
If you are running this in the Visual Studio x64 command window it will set an environment variable Platform=x64 that will be used by msbuild. You can verify this by running echo in the command prompt you are using.
echo %platform%So you will need to override the default when using x64 cmd, or run from the x86 cmd.
–jeroen






