"Configuration" property not working when building a solution?

Hi everybody!

I'm having some problems building a simple C++ console application using MSBuild (VS2005 Beta 2)
From what I've seen I should be able to do this:
MSBuild HelloWorld.sln /t:Rebuild /p:Configuration=Debug
To build my project for Debug only.

However: The above command results inboththe Release and Debug configurations being built, it seems like the Configuration property is ignored?

Turning on diagnostic logging gives me the results below. If you look at the commandline passed to VCbuild.exe no configuration argument is specified, causing all configurations to be built - can anyone tell me what's going on here? I'm I doing something wrong?

Regards
Johan Nyvaller
Build responsible ABB Robotics
Microsoft (R) Build Engine Version 2.0.50215.44
[Microsoft .NET Framework, Version 2.0.50215.44]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

Build started 2005-06-01 14:04:04.
__
Project "C:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\HelloWorld.sln" (Rebuild target(s)):

Target Rebuild:
Using "Warning" task from assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Warning"
C:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\HelloWorld.sln : warning : MSB4098: MSBuild is invoking VCBuild to build this project or solution. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems. Projects that contain such project-to-project references will fail to build. To work around the issue, use "devenv /build" or replace your project-to-project references with references to the built assemblies.
Done executing task "Warning".
Using "VCBuild" task from assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "VCBuild"
Locating vcbuild.exe: found at "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\..\..\vc\vcpackages\vcbuild.exe".
Command:
VCBuild.exe /rebuild "C:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\HelloWorld.sln"
The "VCBuild" task is using "VCBuild.exe" from "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\..\..\vc\vcpackages\vcbuild.exe".
Microsoft (R) Visual C++ Project Builder - Command Line Version 8.00.50215
Copyright (C) Microsoft Corp 1993-2003. All rights reserved.

Rebuild started: Project: HelloWorld, Configuration: Debug|Win32
Deleting intermediate and output files for project 'HelloWorld', configuration 'Debug|Win32'
Compiling...
HelloWorld.cpp
stdafx.cpp
Generating Code...
Compiling manifest to resources...
Linking...
Embedding manifest...
Build log was saved at "
file://c:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\Debug\BuildLog.htm"
HelloWorld - 0 error(s), 0 warning(s)
Rebuild started: Project: HelloWorld, Configuration: Release|Win32
Deleting intermediate and output files for project 'HelloWorld', configuration 'Release|Win32'
Compiling...
stdafx.cpp
HelloWorld.cpp
Generating Code...
Linking...
Embedding manifest...
Build log was saved at "
file://c:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\Release\BuildLog.htm"
HelloWorld - 0 error(s), 0 warning(s)

Build complete: 2 Projects succeeded, 0 Projects failed, 0 Projects skipped
Done executing task "VCBuild".
Done building target "Rebuild" in project "HelloWorld.sln".

Done building project "HelloWorld.sln".

Project Performance Summary:
1719 ms C:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\HelloWorld.sln 1 calls

Target Performance Summary:
1719 ms Rebuild 1 calls

Task Performance Summary:
0 ms Warning 1 calls
1703 ms VCBuild 1 calls

Build succeeded.
C:\MyBuild\Johans Projekt\BuildTest2\sources\HelloWorld\HelloWorld.sln : warning : MSB4098: MSBuild is invoking VCBuild to build this project or solution. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems. Projects that contain such project-to-project references will fail to build. To work around the issue, use "devenv /build" or replace your project-to-project references with references to the built assemblies.
1 Warning(s)
0 Error(s)

Time Elapsed 00:00:01.73

[4938 byte] By [JohanNyvaller] at [2008-2-7]
# 1
Johan,
In Beta 2 msbuild.exe didn't understand solution configurations yet. So when we launched vcbuild.exe we didn't give it any specific configuration, and it's default behavior is to build all configs in that situation.

If you only have VC projects in the solution, you can invoke vcbuild.exe directly on it for now. And if you do vcbuild.exe /? you'll see how to tell it specific configurations (I think it's just "debug" or whatever on the command line).

For the final build, we expect to have fixed this so that we treat solution configurations properly and you should get exactly what you expect to happen. It looks like there might be some interim releases on the web before final release, and if you get a chance to try one of these and give us feedback, that would be great.

Dan (msbuild@microsoft.com)

"This posting provided "as-is", with no warranties."

DanMoseley at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 2

This might be a simple question. I can't seem to find the definitive answers anywhere in the docs. How do you get the output of the VCBuild task?

Basically, I'd like to know if the vcbuild failed or succeeded, then I'd like to pass that to get that result and in turn fail the msbuild or somehow force the result of msbuild to fail, if the vcbuild task fails.

I'm calling msbuild from another script and I'd like to know if everything came out ok or not.

-r-

rich4542 at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 3
just a thought: "hijacking" a two year old thread might not be the best way to get your questions answered Smile

SimonDahlbacka at 2007-9-8 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...

Visual Studio

Site Classified