Prevent Visual Studio from automatically creating Mixed Platforms solution configuration
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
When working with Visual Studio and managing different project types within a solution, developers often encounter a configuration named "Mixed Platforms". This solution configuration is automatically created when the solution contains projects targeting different platforms such as x86 and x64. While useful in some cases, it can lead to misconfigurations and unwanted compilations, thereby causing confusion and increased build times. This article delves into preventing Visual Studio from automatically creating the "Mixed Platforms" configuration, explaining the technicalities and proposing specific strategies.
Understanding Solution Configurations in Visual Studio
Visual Studio solution configurations are ways to systematically organize different build settings for a solution and its projects. A typical scenario can include configurations like Debug or Release, each with its own set of compiler options.
Common Solution Configurations
- Debug: Used during development for debugging, with optimizations disabled.
- Release: Used for production builds, with optimizations enabled.
Mixed Platforms Configuration
The "Mixed Platforms" configuration is especially relevant when you have a solution with multiple projects targeting different architectures or platforms. This configuration is automatically created by Visual Studio to accommodate every project under a single build option despite differing platform targets.
Why You Might Want to Avoid It
- Build Errors: It might silently assign incorrect platform settings to a project, leading to build failures.
- Increased Build Time: Can unnecessarily trigger builds for projects that do not need it due to mismatched platform settings.
- Configuration Drift: Manages several projects with different settings, complicating version control management.
Technical Strategies to Prevent Automatic Creation
Step 1: Manual Configuration Management
The first step is to assert control over solution configurations and manage them manually:
- Navigate to the Configuration Manager in Visual Studio.
- Manually create configurations tailored to your projects, ensuring that each has precisely defined platform targets.
- Remove unused or unwanted configurations:
- Click on "Active solution platform".
- Select ``<Edit...>``.
- Delete "Mixed Platforms" if present.
- Open each project's `Properties` window.
- Navigate to the "Build" tab, and specify the desired platform for each configuration.
- Check consistency between project configurations and solution configurations.
- Use the Visual Studio SDK to create IDE extensions.
- Develop scripts using PowerShell or MSBuild.
Related reading
- printing all contents of array in C
- Priority queue in .Net
- Problems creating a Foreign-Key relationship on Entity Framework
- Process.start how to get the output?
- Process.WaitForExit asynchronously
- Produce a random number in a range using C
- Programmatically detecting Release/Debug mode .NET
- programmatically get BPM of a wave or MP3 from .Net

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.