Solved

32-bit vs 64-bit: Do I have to build my application specifically for either platform?

Posted on 2006-10-26
5
282 Views
Last Modified: 2012-06-27
Hello all,

I've been  building VB.NET rich applications, both from Visual Studio 2005 and the VB Express edition.

When I build an application on a 32-bit machine, and then copy it to a 64-bit box, does the .NET framework automatically run it as a 64-bit application, or is it stuck at 32?

Seems like it should automatically work as a 64-bit app, but I'm not sure.

Any clarification would be greatly appreciated.
Thanks!

David
0
Comment
Question by:Inward_Spiral
  • 2
5 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 17813546
It runs in a mode called WOW64

Here are some links to help you understand what happens.

WOWing Your 32-Bit Applications with 64-Bit Windows Part 1
http://www.devx.com/amd/Article/20342?type=kbArticle&trk=MSCP

WOWing Your 32-Bit Applications with 64-Bit Windows, Part 2
http://www.devx.com/amd/Article/20367?type=kbArticle&trk=MSCP

Migrating 32-bit Managed Code to 64-bit
http://msdn2.microsoft.com/en-us/library/ms973190.aspx

Fernando
0
 

Author Comment

by:Inward_Spiral
ID: 17813826
I found this blurb in the "Migrating 32-bit Managed Code to 64-bit" article:

 - 64-bit—denotes that the developer has built the assembly specifically targeting a 64-bit process.
 - 32-bit—denotes that the developer has built the assembly specifically targeting a 32-bit process.
    In this instance the assembly will run in WoW64.
 - Agnostic—denotes that the developer built the assembly with Visual Studio 2005, code-named "Whidbey".
   or later tools and that the assembly can run in either 64-bit or 32-bit mode. In this case, the 64-bit Windows loader  
   will run the assembly in 64-bit.
 - Legacy—denotes that the tools that built the assembly were "pre-Whidbey". In this particular case the assembly will
   be run in WoW64.

Since I'm developing in Visual Studio 2005 (or in one case, VB 2005 Express), I think my application falls under the "Agnostic" category. So, I shouldn't have to change anything for it to be able to work as a 64-bit application, correct?

0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 100 total points
ID: 17814149
Not the second paragraph when it talks about being 100% type safe

Keep in mind that a developer marking an assembly as Win64 determined that all dependencies of the application would execute in 64-bit mode. A 64-bit process cannot use a 32-bit component in process (and a 32-bit process cannot load a 64-bit component in process). Keep in mind that the ability for the system to load the assembly into a 64-bit process does not automatically mean that it will execute correctly.

So, we now know that an application comprised of managed code that is 100% type safe can be copied (or xcopy deploy it) to a 64-bit platform and have it JIT and run successfully with .NET in 64-bit mode.

However, we often see situations that aren't ideal, and that brings us to the main focus of this paper, which is to increase awareness of the issues related to migrating.

You can have an application that isn't 100% type safe and that is still able to run successfully in 64-bit under .NET. It will be important for you to look at your application carefully, keeping in mind the potential issues discussed in the following sections and make the determination of whether you can or cannot run successfully in 64-bit.

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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 …
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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