PDA

View Full Version : Make VS action uses incorrect MSBuild


nikolaynnov
06-01-2015, 05:51 AM
There is a build script to build 2 projects for MSVS2008 (2 .vcproj files + 1 .sln) and a few projects for MSVS2013 (only .vcxproj files). To build vcproj a "Make VS 2008" step is used. To build vcxproj a "Make VS2012" step is used. Till today everything was fine. But today I have installed path KB976656 (http://thehotfixshare.net/board/index.php?autocom=downloads&showfile=11640) for VS2008 to fix fatal error C1859. Afterwards the vcproj is compiled ok, but when running step "Make VS 2012" on vcxproj, incorrect version of devenv is used:
01.06.2015 13:37:08: Building subroutine step 19 - window...
Pre-processing...

Rebuilding configuration 'Release|Win32'...
Command: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" D:\buildscripts\8_7_39\trunk\NISS400\Slaves\window \App.vcxproj /rebuild "Release|Win32"
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" D:\buildscripts\8_7_39\trunk\NISS400\Slaves\window \App.vcxproj /rebuild "Release|Win32"

Microsoft (R) Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.

Exception has been thrown by the target of an invocation.
Invalid solution configuration

Use:
devenv [solutionfile | projectfile | anyfile.ext] [switches]
...


Output from cmd:
C:\Users\build>where msbuild
INFO: Could not find files for the given pattern(s).

C:\Users\build>where vcbuild
INFO: Could not find files for the given pattern(s).

C:\Users\build>

Output from VS2008 cmd:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>where msbuild
C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.ex e
C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBu ild.exe

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>

Output from VS2013 cmd:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>where msbuild
C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBu ild.exe

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>

All vcxproj-files starts with following lines:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">


If I use "Override default DEVENV/MSBUILD/VCBUILD location" field (C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe) it is also successfully compiled. But I'am looking for a solution to don't override default msbuild location because I suspect there will some problems later after migration to VS2015.

So my questions:
- Encountered anyone with this problem before?
- How to resolve it?
- How VBP determines which version of msbuild has to be used?
- Is there a way to define a global (only one time) option for all steps "Make VS 2012"?

kinook
06-01-2015, 07:07 AM
Please see http://www.kinook.com/Forum/showthread.php?t=4500

And then http://www.kinook.com/Forum/showthread.php?t=3044 if that doesn't help.

nikolaynnov
06-01-2015, 11:44 PM
As I see in (http://www.kinook.com/Forum/showthread.php?t=4500) VB analyzes sln files only to determine version of msbuild which has to be used. It seems it is a root cause of my problem as I don't have sln files for lots of my projects. Only vcxproj-files. :(
I hope VB team will fix it and in next versions the VB will analyze vcxproj-files as well.

nikolaynnov
06-02-2015, 01:26 AM
It seems this issue is fixed in VBP 8.7. But still as make it work in VBP 8.2 without "Override default DEVENV/MSBUILD/VCBUILD location" field? Setting correct vcvars before calling visbuildpro.exe is not working.

nikolaynnov
06-02-2015, 02:49 AM
Tested in VBP 8.5: it works!!!
Ok, I will update VBP.
Thanks everybody.