Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the Visual Studio "Any CPU" target mean?

I have some confusion related to the .NET platform build options in Visual Studio 2008.

What is the "Any CPU" compilation target, and what sort of files does it generate? I examined the output executable of this "Any CPU" build and found that they are the x86 executables (who would not see that coming!). So, is there any difference between targeting executable to x86 vs. "Any CPU"?

Another thing that I noticed, is that managed C++ projects do not have this platform as an option. Why is that? Does that mean that my suspicion about "Any CPU" executables being plain 32-bit ones is right?

like image 355
galets Avatar asked Feb 05 '09 16:02

galets


People also ask

How do you change active solution platform from any CPU to x86?

Click Configuration Manager. In the Configuration Manager dialog, open the Active solution platform drop-down list box and click <New> …. In the New Solution Platform dialog, select x64 in the Type or select the new platform drop-down list box. Select x86 in the Copy settings from drop-down list box.

What is active solution platform?

The Active Solution Platform allows you to configure a specific combination of configurations for each project. The Project Platform allows you to make specific configuration settings for a project.


1 Answers

An AnyCPU assembly will JIT to 64-bit code when loaded into a 64-bit process and 32 bit when loaded into a 32-bit process.

By limiting the CPU you would be saying: There is something being used by the assembly (something likely unmanaged) that requires 32 bits or 64 bits.

like image 183
AnthonyWJones Avatar answered Sep 30 '22 21:09

AnthonyWJones