简体   繁体   中英

Visual Studio solution file - what does the “Build.0” mean?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM