How can I tell if an app is 32 or 64 bit?

using Visual Studio, How can I tell if an app is 32 or 64 bit?
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
it_saigeDeveloperCommented:
Not true Miguel.  You can compile any project of any language to any specifications you, as the developer, require.

As to the answer to your question.  As a rule a VS project can be built for a specific platform or all platforms.Capture.JPGChoosing the platform tells the compiler where to put the assemblies based on the Build output path.
You can choose your Advanced Compile Options to determine the CPU type to build for; x86, x64, Itanium or AnyCPU.Capture.JPGAnd you can add/edit the configuration by using the configuration manager.Capture.JPGCapture.JPG
By definition a project built for a specific platform can only run on a platform that:
A. Explicitly meets the requirements to run the project output.
B. Contains an emulator that can replicate the requirements to run the project output.

This is essentially how Windows x64 OS's can run 32-bit applications.  However, you are right, a 32-bit application can run in a 64-bit environment, but a 64-bit application cannot run in a 32-bit environment.

-saige-
0
 
Miguel OzSoftware EngineerCommented:
IF you're using .NET 4.0 or greater, use the new Is64BitProcess Property:

Environment.Is64BitProcess

Open in new window

0
 
HLRosenbergerAuthor Commented:
Let me clarify - Isn't an executable built for either 32 or 64 bit?   Then I would assume that a 32-bit exe can run in 64 bit space, but not vice versa, of course.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Miguel OzSoftware EngineerCommented:
You can build (platform) as any CPU, and .NET run time will pick up how to run your app based on the OS.
I think you are after the compile platform info. Go to project properties, compile tab and on the top you will find platform combo box.
From memory I do not think you can build vb.net apps for x86 or x64, only any CPU is the option available.
0
 
HLRosenbergerAuthor Commented:
Thanks!  that's what I was looking for.
0
 
HLRosenbergerAuthor Commented:
Followup question - If under Platform I only have the Active x86 option, what does that mean?
0
 
it_saigeDeveloperCommented:
That just means that you do not have a configuration built for x64, Itanium or Any CPU...  Which is why I posted that you can add/edit the configurations...

-saige-
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.