Solved

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

Posted on 2006-10-26
5
263 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now