BT

Microsoft Redefines AnyCPU for Visual Studio 11 and .NET 4.5

by Jeff Martin on Apr 12, 2012 |

Since the introduction of 64-bit computing, developers have had to manage the differences between 64-bit and 32-bit platforms. Microsoft provides C# developers on Visual Studio with the AnyCPU compiler setting. This setting allows developers to specify which common language runtime platform should be targeted, and the change will support the ARM architecture by default.

The following screenshots illustrate the changes:

Visual Studio 2010

On VS 2010, these options are:

  • x86 (default)
  • Itanium
  • x64
  • anycpu

Visual Studio 11

Now Microsoft is making changes and with VS 11 and .NET 4.5 the available options are:

  • x86
  • Itanium
  • x64
  • anycpu
  • anycpu32bitpreferred (default)

AnyCPU, 32 Bit is the new default under VS11. As developer and Microsoft MVP Sasha Goldshtein has noted, this is contrary to what VS11 displays on the project's properties screen (which shows AnyCPU as the default and does not allow AnyCPU, 32-bit to be selected).

 

Goldshtein comments: 

The difference, then, between “Any CPU 32-bit preferred” and “x86” is only this: a .NET application compiled to x86 will fail to run on an ARM Windows system, but an “Any CPU 32-bit preferred” application will run successfully."

Developers migrating should be sure to review their project properties as they migrate to VS11 so that they are targetting their intended platforms.

 

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT