kinook
05-19-2010, 04:56 PM
It is Visual Studio (msbuild/devenv) that actually performs the building of a Visual Studio solution or project (and is reporting the error), not Visual Build itself. Building a VS project from the command-line is not identical to building in the VS IDE. If building via MSBuild does not work, try using devenv (enter devenv in the Override field on the Options tab (http://www.kinook.com/VisBuildPro/Manual/vsnetoptionstab.htm)), as this will be closer to what the IDE does when building (and MSBuild is not able to build solutions containing Setup and Deployment projects). Even then, we have heard of situations where building from the command-line doesn't work even when building in the IDE does. You can check the Log the command-line checkbox on the Advanced tab, rebuild the step, and provide the msbuild/devenv command to Microsoft when submitting a support incident.
Also, when opening older solution versions in VS 2012 or later, the files are not automatically converted to the new version format, and since the Make VS* actions use the Visual Studio version declared in the solution or project file to determine which version of msbuild or devenv to call, follow one of these methods to force it to use the newer version of VS/MSBuild for building:
1) Convert your solutions to the newer format via File | Save As on the menu in Visual Studio
or
2) Edit the comment line in the .sln file (# Visual Studio 2010 [2012, 2013, 14, 15, 16], # Visual Studio Version 17) to indicate which version of Visual Studio / MSBuild to build with.
or
3) Specify the full path and filename for the appropriate msbuild.exe or devenv.com in the Override field on the Options tab (http://www.kinook.com/VisBuildPro/Manual/vsnetoptionstab.htm) of the Make VS* action.
In addition, to build solutions containing C++ projects with MSBuild, the Visual Studio environment matching the solution file may need to be initialized by either
1) starting Visual Build (start visbuildpro) from a Visual Studio Command Prompt
or
2) running the VS environment batch file from the Command to run before main command field on the Advanced tab of the Make VS action:
VS 2008:
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
VS 2010:
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
VS 2012:
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86
VS 2013:
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
VS 2015:
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
VS 2017:
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.ba t"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
https://msdn.microsoft.com/en-us/library/f2ccy3wt(v=vs.140).aspx
VS 2019:
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.ba t"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
https://docs.microsoft.com/en-us/cpp/build/setting-the-path-and-environment-variables-for-command-line-builds?view=vs-2019
VS 2022:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\VsDevCmd.ba t"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170
Also, when opening older solution versions in VS 2012 or later, the files are not automatically converted to the new version format, and since the Make VS* actions use the Visual Studio version declared in the solution or project file to determine which version of msbuild or devenv to call, follow one of these methods to force it to use the newer version of VS/MSBuild for building:
1) Convert your solutions to the newer format via File | Save As on the menu in Visual Studio
or
2) Edit the comment line in the .sln file (# Visual Studio 2010 [2012, 2013, 14, 15, 16], # Visual Studio Version 17) to indicate which version of Visual Studio / MSBuild to build with.
or
3) Specify the full path and filename for the appropriate msbuild.exe or devenv.com in the Override field on the Options tab (http://www.kinook.com/VisBuildPro/Manual/vsnetoptionstab.htm) of the Make VS* action.
In addition, to build solutions containing C++ projects with MSBuild, the Visual Studio environment matching the solution file may need to be initialized by either
1) starting Visual Build (start visbuildpro) from a Visual Studio Command Prompt
or
2) running the VS environment batch file from the Command to run before main command field on the Advanced tab of the Make VS action:
VS 2008:
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
VS 2010:
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
VS 2012:
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86
VS 2013:
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
VS 2015:
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
VS 2017:
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.ba t"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
https://msdn.microsoft.com/en-us/library/f2ccy3wt(v=vs.140).aspx
VS 2019:
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.ba t"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
https://docs.microsoft.com/en-us/cpp/build/setting-the-path-and-environment-variables-for-command-line-builds?view=vs-2019
VS 2022:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\VsDevCmd.ba t"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170