33

I'm looking at my Visual Studio .sln file as I'm customising build configurations (the reason why is a long story involving projects that won't load in VS2012).

Does anyone know what the Build.0 part of the build config section means? Does it mean that this project is ticked to be built under this build configuration?

Also, what does the ActiveCfg relate to?

{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|Mixed Platforms.ActiveCfg = Debug|AnyCPU
{CFHHHA78-C688-40B3-B53A-20C963A6F138}.Debug|x86.ActiveCfg = Debug|Any CPU

Any links to .sln file walkthroughs would also be welcome. As always, the MSDN .sln file explanation is a little cryptic and doesn't seem to fully explain this part of the sln file.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
WheretheresaWill
  • 5,882
  • 7
  • 30
  • 43
  • Taking a dependency on this is pretty dangerous, a future VS release is liable to break you. Fairly sure that this is is directly connected to the Build + Configuration Manager dialog. You'll have to experiment. – Hans Passant Jun 28 '13 at 11:30
  • Your first question answer - YES it is ticked to be build under the current configuration. Answer to the 2nd Question - [this](http://msdn.microsoft.com/en-us/library/aa234586%28v=vs.60%29.aspx) may answer it. This is also my understanding – ha9u63a7 Jun 28 '13 at 11:31

2 Answers2

12

Yes, your hunch was right. It does mean that the project has its Build option ticked to build under the build configuration. I just tested this by opening the solution in one instance of Visual Studio and the .sln file in the text editor (open with) of another Visual Studio instance. If you change the configuration options in the first and save all, you will see the appropriate changes in the second.

PfhorSlayer
  • 1,337
  • 9
  • 14
Cameron Taggart
  • 5,771
  • 4
  • 45
  • 70
  • What does "the project is ticket to build under the build configuration" suppose to mean? How it is different from ActiveCfg? – Mikhail Nov 11 '16 at 08:51
  • 1
    In the Configuration Manager in VS, you can choose which projects will be built and with which project configuration and platform for each solution configuration and platform pair. If the "project is [ticked] to build," then it will build when that solution configuration is built. If it isn't, it will not be. – PfhorSlayer May 03 '17 at 18:50
  • Hmm, I am wonder what it does, when ActiveCfg will be different from Build.0. Even more, what it does, when there will be more then one Build.x configuration, let's say Build.0 and Build.1 for ex. – Vizor May 23 '19 at 10:19
  • That sounds like a fun experiment @Vizor ^^ – Markus Szumovski Sep 23 '21 at 12:10
11

I'm not 100% sure (haven't found any source to confirm my guess), but I believe the .ActiveCfg and Build.0 in the entries withing the GlobalSection(ProjectConfigurationPlatforms) section are being used as described below.

{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3759D495-6929-4371-92B1-E0C0F5215051}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU

If I set the solution's Configuration property to "Debug" and set the Platform property to "Any CPU", according to the above entries, the project will build, because of the Build.0 line, and the Configuration and Platform properties will be set to "Debug" and "Any CPU" for building that project, since that is what the ActiveCfg line says to send to the project when building using that combination of Configuration and Platform properties.

If I set the Configuration property to "Debug" and set Platform to "Mixed Platforms", the solution will build the project, but it will still use "Debug|Any CPU" for the Configuration and Platform properties, since that is what the ActiveCfg line says to send.

Zack
  • 2,789
  • 33
  • 60
  • 1
    +1 Excellent explanation. I have always wondered exactly how this was working. I will confirm your understanding with some changes and commits and try to remember to post another comment... – MemeDeveloper Mar 07 '19 at 23:25