Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio from automatically creating "Mixed Platforms" solution configuration

How do I prevent Visual Studio 2008 from automatically creating the "Mixed Platforms" and "Any CPU" solution configurations? We have "Win32" and "x64" configurations and a developer needs to choose between them. However, as soon as anyone makes any changes to the solution VS automatically creates "Mixed Platforms" and it seems to be the default configuration. This causes a lot of issues, because it turns out some new projects are not selected in this configuration or the wrong project configuration is selected, etc. I just want to stop it doing that and manage the solution configurations myself.

like image 318
EMP Avatar asked Oct 16 '08 06:10

EMP


People also ask

How do I change the build configuration platform in Visual Studio?

Click TOOLS > SETTINGS > check EXPERT SETTINGS to see the build configuration manager (This is only applicable to Visual Studio 2010 Express Edition and NOT for 2008 Express Edition) Click BUILD > CONFIGURATION MANAGER select the platform dropdown to X86 and click CLOSE.

What is solution configuration in Visual Studio?

Applies to: Visual Studio Visual Studio for Mac Visual Studio Code. Solution configurations store solution-level properties. They direct the behavior of the Start (F5) key and Build commands. By default, these commands build and start the debug configuration.


3 Answers

We see a similar issue with Visual Studio 2005 projects that we want to build both for a Win32 configuration and for a number of distinct smart device platform/configuration combinations.

At arbitrary times, every configuration gets auto-generated for every platform, whether it's valid or not, exploding the size of each of our ~50 project files and causing a lot of work to fix the issue.

It consistently happens when we open the Configuration Manager dialog, and it sometimes (but not always) happens when changing a project setting for a configuration. In the latter case, it seems to be related to manipulating the platform and configuration drop-downs on the project setting dialog.

We filed it as a Visual Studio issue; MSFT closed it as "won't fix".

like image 71
Tim Lesher Avatar answered Oct 09 '22 09:10

Tim Lesher


I've been dealing with the same sort of problem. I agree it is a mess. I've seen two viable options for dealing with it - neither are really what you want.

  1. Manually remove the configurations that it creates by going to the configuration chooser and picking edit...
  2. By default (at least if I start with a fresh solution in VS 2010) and start creating new projects (both class libraries and apps), you end up with Any CPU, Mixed Platforms, and x86 for your Solution Platforms. Visual Studio seems to do a good job adding new class libraries to both Any CPU and Mixed Platforms (since they default build for the Any CPU target) and adding new apps to both Mixed Platforms and x86 (since the default build for the x86 target), and putting both new class libraries and new apps to Mixed Platforms. So Mixed Platforms ends up being a nice default since it builds everything. I'm not sure why it's not adding new projects for you to Mixed Platforms
like image 20
aggieNick02 Avatar answered Oct 09 '22 09:10

aggieNick02


You could filter your .sln files in a commit hook of your source control. So that if you check it in the .sln file and possibly the project files get fixed. The open source Chromium project has such a filter implemented.

like image 44
frast Avatar answered Oct 09 '22 07:10

frast