Solved

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

Posted on 2006-10-26
5
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 63

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 63

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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