Build Configuration: Mixed Platform VS Any CPU
Asked Answered
G

4

100

What's the difference between different Build Configuration settings e.g. Any CPU, Mixed Platform, WIN32 etc in Visual Studio.

Glomerulonephritis answered 18/4, 2011 at 12:24 Comment(0)
H
45

Here's a link that helps explain the build configuration setting found in Visual Studio and its build files:

http://web.archive.org/web/20151215192101/http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/

Basically the setting states what platform the assembly is able to run on. When AnyCPU is selected, the resultant DLL is marked as able to run anywhere; when x86 is selected, the resultant DLL is marked as only being able to run on 32-bit systems and will not run in 64-bit applications or processes (but will run in 64-bit Windows;) and so on and so forth.

This just sets flags on the compiled DLL - it does not change other aspects of compilation process at all.

Hooker answered 18/4, 2011 at 16:42 Comment(4)
Also, check out this link on solution file interactions: social.msdn.microsoft.com/forums/vstudio/en-US/…Taction
This doesnt seem to explain "Mixed Platforms" though.Heathen
@Heathen My understanding (from a lost reference) is that when you open a solution in which all projects do not have the same configuration, Visual Studio shows/chooses the solution configuration as Mixed Platforms. (If I can find the original reference, I'll amend this with a citation.)Garboard
The link visualstudiohacks.com/articles/… is dead.Procora
T
52

As other platforms are already explained (i.e. X86 for 32 bit, x64 is for 64bit only, and 'Any CPU' can run in Both) I'll concentrate on Mixed Platform and how this is different from Any CPU.

The Any CPU is at the project level setting, whereas in the real world solution we have a number of projects under one solution, and there's a chance that some of my project use Any CPU but other uses the x86 or x64 build platform.

So at solution level automatically Mixed Platform will be selected. This indicates that during Build/Rebuild solution each project builds based on its selected platform.

Tetherball answered 30/8, 2016 at 13:43 Comment(0)
H
45

Here's a link that helps explain the build configuration setting found in Visual Studio and its build files:

http://web.archive.org/web/20151215192101/http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/

Basically the setting states what platform the assembly is able to run on. When AnyCPU is selected, the resultant DLL is marked as able to run anywhere; when x86 is selected, the resultant DLL is marked as only being able to run on 32-bit systems and will not run in 64-bit applications or processes (but will run in 64-bit Windows;) and so on and so forth.

This just sets flags on the compiled DLL - it does not change other aspects of compilation process at all.

Hooker answered 18/4, 2011 at 16:42 Comment(4)
Also, check out this link on solution file interactions: social.msdn.microsoft.com/forums/vstudio/en-US/…Taction
This doesnt seem to explain "Mixed Platforms" though.Heathen
@Heathen My understanding (from a lost reference) is that when you open a solution in which all projects do not have the same configuration, Visual Studio shows/chooses the solution configuration as Mixed Platforms. (If I can find the original reference, I'll amend this with a citation.)Garboard
The link visualstudiohacks.com/articles/… is dead.Procora
S
18

The build configuration names don't mean very much - they proliferate if you have C++ and C# projects in the same solution (and even worse if you have mobile projects too), because the various types of projects use different configuration names, so you end up with lots of them.

We try to keep deleting all the configurations we're not using, but that's hard work sometimes as often when you add a new project, unwanted configurations will be added back to the solution.

My recommendations is to decide on what configurations you need (by looking at the actual settings within them), and then remove everything else.

Sizzler answered 18/4, 2011 at 12:30 Comment(0)
S
11

From: this post. https://social.msdn.microsoft.com/forums/vstudio/en-US/81c72e8b-6335-4bf4-b7c0-b5c322edcaee/mixed-platforms-vs-any-cpu

When all of the projects in a solution are of the same type (e.g. C#/VB projects) the solution configurations will match up exactly with the project configurations. Once you have projects in a solution that have mismatched configurations/platforms, Visual Studio creates the solution level configuration(s) "Mixed Platforms/Debug" and possibly "Mixed Platforms/Release". These configurations are just mappings to individual project level configurations.

For example, if you have a C# project and a C++ project, typically "Mixed Platforms/Debug" will map to "Any CPU/Debug" for the C# project and "Win32/Debug" for the C++ project.

Stere answered 8/10, 2015 at 14:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.