Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Configuration: Mixed Platform VS Any CPU

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

like image 608
Rohit Avatar asked Apr 18 '11 12:04

Rohit


People also ask

How do I change a platform target from X86 to a CPU?

Select x86 in the Copy settings from drop-down list box. Click OK. In the Configuration Manager dialog, be sure the box in the Build column is checked for all projects in the solution. Click Close.

How do I change from X86 to x64 in Visual Studio?

To configure a project to target a different platformOn the menu bar, choose Build > Configuration Manager. In the Active solution platform list, choose a platform for the solution to target, and then choose the Close button.

How do I add X86 to 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.

How do I run Visual Studio in 64-bit mode?

From the Visual Studio menu, choose Test, then choose Settings, and then choose Processor Architecture. Choose x64 to run the tests as a 64-bit process.


2 Answers

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.

like image 162
Neha Jain Avatar answered Sep 22 '22 10:09

Neha Jain


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.

like image 44
porusan Avatar answered Sep 20 '22 10:09

porusan