Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the currently selected "Solution Configuration" option stored in VS 2010 or 2012?

In VS 2010, or VS 2012, you can pick a "Solution Configuration", that has been custom defined, that can define local variables used with the #if #elif #endif syntax to change your code dynamically through that drop down. Also in that configuration, you can choose whether it's built or deployed, platform you're targeting, and the local configuration you want to use per project.

When you choose a configuration, then close Visual Studio, and re-open Visual Studio, it remembers what configuration you chose, what I can't seem to figure out, is where it saves/stores that configuration information, and I need to automate it.

Does anyone know of either:

  • A way to use the command line compiler to automate solution level builds using solution configurations
  • Where Visual Studio stores the currently selected configuration information
  • Or, ideally, both?
like image 963
Brian Deragon Avatar asked Oct 17 '25 19:10

Brian Deragon


1 Answers

Visual Studio actually stores a solution's build configuration selections in the solution file itself. Even though the "*.suo" file is not checked into version control, the solution's build configuration selections will propagate to other machines that are sync'ed to the same version control system.

If you open a "*.sln" file, you will see a section called "GlobalSection(ProjectConfigurationPlatforms)". If a project is not checked for build or deploy, you will see something like this:

{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU

The ".0" strings indicate that the the build and deploy are unchecked.

like image 101
Xiaodong Tan Avatar answered Oct 19 '25 13:10

Xiaodong Tan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!