Solved

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

Posted on 2014-12-16
7
148 Views
Last Modified: 2014-12-17
using Visual Studio, How can I tell if an app is 32 or 64 bit?
0
Comment
Question by:HLRosenberger
  • 3
  • 2
  • 2
7 Comments
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 40503540
IF you're using .NET 4.0 or greater, use the new Is64BitProcess Property:

Environment.Is64BitProcess

Open in new window

0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 40503545
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
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 40503560
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 40503691
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
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 40504599
Thanks!  that's what I was looking for.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 40504610
Followup question - If under Platform I only have the Active x86 option, what does that mean?
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40504701
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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question