Solved

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

Posted on 2014-12-16
7
155 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 36

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 36

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

740 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