Running DotNet application under 64-bit

April 23, 2008 at 8:03 am 2 comments

Recently, someone asked me to help with getting an existing Dotnet application to run on 64-bit XP. It turned out to be pretty easy, compared to the transition from 16-bit to 32-bit in the old days.

Why would you run 64-bit?

Most of the modern processor these days are 64-bit CPU, but we still live in a mostly 32-bit world. One chief reason is that 64-bit drivers are not yet available. Application compatibility is less of an issue because 64-bit windows can run 32-bit application under WOW (windows on windows). When I do see people run 64-bit OS, it is usually because they are either diehard hobbist who want the latest and greatest or they are using application that requires a large amount of memory.

DotNet under 64-bit

  • Microsoft has 32-bit and 64-bit runtime for DotNet 2.0 or above. When you install the 64-bit runtime, the 32-bit runtime is also installed.
  • Dotnet assemblies compile into MSIL (Microsoft Intermediate Language). MSIL can run in 32-bit or 64-bit mode.
  • When you compile, you have the option to compile Any CPU, x86, x64 and Itanium. Remember that DotNet does not compile into machine specific code but into MSIL. This merely set a flag to tell DotNet which environment to run in.
  • If you set the flag to any cpu, it will run in 64-bit on 64-bit machine and 32-bit on 32-bit machines.
  • If you set the flag to x86 and run it on a 64-bit machine, it will run the program under WOW in 32-bit emulation mode.
  • If you set the flag to x64 and run it on a 32-bit machine, you will get an exception.
  • The only reason you want to set the flag is dependencies. If you reference 32-bit code within your application (such as unmanaged COM code), you will need to run the application under 32-bit mode.
  • Note that DotNet 1.1 or earlier are available only in 32-bit mode. If you reference DotNet 1.1 code, you will need to run it in 32-bit mode.

 

Advertisements

Entry filed under: .Net.

Organizing NUnit Test in a .Net or MonoDevelop Solution Mandriva 2008.1 on Acer Aspire 3680-2622 Laptop

2 Comments Add your own

  • 1. Steave Thomason  |  February 16, 2010 at 10:12 am

    It was rather interesting for me to read that blog. Thanks the author for it. I like such topics and anything connected to this matter. I would like to read more soon.

    Truly yours

    Reply
  • 2. Ata Demiray  |  April 20, 2010 at 3:06 am

    Thank you very much for the information , my DOTNET application which was messaging with a 32 bit C++ application crash on 64 bit systems , it was build in Any CPU configuration , I think I need to change that to x486 , because the C++ application is build in 32 bit and it works as 32 bit on 64 bit systems too.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

April 2008
M T W T F S S
« Feb   May »
 123456
78910111213
14151617181920
21222324252627
282930  

Most Recent Posts


%d bloggers like this: