1

in my VC++ 2015 project, I have two platform configuration, Win32 and x64 for the solution file

MyProject.sln contains multiples projects that able to build for Platform Win32 and x64

I have specific project build is uncheck in Configuration Manager for x64

For example, MyProject.sln contains Project1 and Project2, only Project1 will have both Platform Win32 and x64 going to build, Project2 will only build for Win32

msbuild "MyProject.sln" /p:platform=Win32 /p:configuration=Debug /t:rebuild // this work

msbuild "MyProject.sln" /p:platform=x64 /p:configuration=Debug /t:rebuild // this doesn't work

msbuild will try to build Project2 as well, but it will failed due to the dependend lib is not found, in fact, i want it to exclude Project2 from build, but somehow msbuild does not respect the .sln settings

i open up MyProject.sln in notepad and notice it is clearly Project2 not include in x64 build

anyway to exclude the Project2 build in Platform x64 when using msbuild? build through VS2015 IDE has no issue because the Configuration Manager I have uncheck it from build.

hghew
  • 311
  • 2
  • 4
  • 15
  • 1
    Can't reproduce. When creating a new solution and adding two new c++ projects, then going to configuration manager and disabling x64 build for Prohect2, *msbuild "MyProject.sln" /p:platform=x64 /p:configuration=Debug* outputs *The project "Project2" is not selected for building in solution configuration "Debug|x64".*, as expected. So the information you provide in your question is incomplete, or you hit a weird VS bug. I'd suggest to first try everything from scratch as well (new solution, new projects) – stijn Aug 03 '16 at 07:26
  • @hghew, I can't reproduce too. As stijn said that try it with new solution and projects. – starian chen-MSFT Aug 05 '16 at 03:04
  • when i build inside VS IDE, only rebuild all for x64, it will auto build certain Win32 projects which does not have any x64 config, i ended up have to remove the project dependency, the rebuild all for x64/Win32 config only behavior inside VS IDE and msbuild is somehow act differently – hghew Aug 12 '16 at 02:16
  • @hghew share the sample project on the OneDrive. – starian chen-MSFT Aug 16 '16 at 01:18

1 Answers1

0

@hghew, Like this case, please add a solution platform "Win32" like the following screen shot.

enter image description here

Community
  • 1
  • 1
Jack Zhai
  • 6,230
  • 1
  • 12
  • 20