?
Solved

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

Posted on 2006-10-26
5
Medium Priority
?
314 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
3 Comments
 
LVL 64

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 64

Accepted Solution

by:
Fernando Soto earned 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

864 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