With a project opened, go to Build – Configuration Manager to follow along.
A solution configuration is just the collection of all its projects’ configurations. For example, let’s suppose we’re working with a solution that contains 2 projects. Each project will have its own configuration, whether it is debug or release or something new you’ve created. Each of these gets rolled-up into the solution configuration. By default, the “Release” solution configuration contains all “Release” project configurations, whereas the “Debug” solution configuration consists of “Debug” project configurations. There’s nothing keeping you from changing each of the project configurations under the “Debug” solution configuration to “Release”, except for the sanity of those working with you on the project. =)
Today I was given a great example explaining all of this using a time-bomb release (thanks Izzy!) In your VB Console App project (I’m just going with this sort of project for example purposes), first create a new project configuration called “TIMEBOMB” from the configuration manager (Just select <New> in the Project Configurations drop down). Notice how this changes the active solution configuration to “TIMEBOMB”. Now bring up project properties, click on the left-Compile tab, and change Configurations to TIMEBOMB. Now press “Advanced Compile Options” (note: other language may have slightly different UI). Select “Generate debug info:” to either pdb-only or full and add “TIMEBOMB” to the custom constants. Press OK and then do a Save.
Go to Module1.vb and in Sub Main() add
#If TIMEBOMB Then
MsgBox("Evaluation time has expired. We now return you to your regularly scheduled Operating System, already in progress…")
Save, Hit F5, and watch your timebomb go off perfectly. If you were to go back to configuration manager and change the active solution configuration to something else, like Release, you won’t see the timebomb.
In Part 2, I’ll cover Active Solution Platforms.
Happy Visual Studio’ing!