0

How will my .NET application run under Windows 2008 x64? As a 32 bit application or as a 64 bit? Does that make any difference?

6 Answers 6

5

It'll run 64 bit if it's targeting 64bit architecture, or is set to run on Any platform.

It'll run 32 bit if it's targetted for 32bit architecture. If you need to use native DLLs, you'll want to make sure it's targetted correctly.

This will work the same as 64bit Vista.

2

If you compile it with the "run on any machine option" it will run as a 64 bit application.

If force it to compile as "run as 32 bit" then it will run as a 32 bit app on an x64 machine.

0

Depends on how you built it, and how you should have built it. :-) If you didn't specify a specific model then your app will run as a 32-bit on x86 and a 64-bit on x64. This is generally what you want. The exceptions to this start popping up when you're interoperating with 32-bit code on the 64-bit system. For example, if you're calling out to a DLL that expects an 'int' to be 32-bits and you pass it 64 bits then things go very wrong very fast.

0

.net code copiled to target 'any' platform (check out the projects build configuration) will be compiled from IL into 64bit machine code instructions. if you specify 32bit then it will be compiled into 32bit and then converted as if it was 32bit machine code running on a 64bit OS!

There are some compatability issues with some libraries when compiled into 64bit code.

Edit: XNA is an example of where you would want to target 32 specifcally, check out this: http://www.brianpeek.com/blog/archive/2007/11/13/x64-development-with-net.aspx

Note: Int is int regardless of what platform it's running on? aint it?

2
  • yes int is an int no matter if your 32 or 64bit from Dot Net's perspective BUT memory pointers IntPtr "The IntPtr type is designed to be an integer whose size is platform-specific. ... is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit." Mar 13, 2009 at 20:31
  • I see..! but as i see it, you can't load a 32bit dll into a 64bit processs so is that, in fact, incidental?
    – Dog Ears
    Mar 13, 2009 at 20:54
0

After my question here and the answer to it, I'll think twice about allowing an application to run as 64-bit. It seems the 64-bit JIT is really limited compared to the more mature 32-bit JIT.

0

If it is an ASP.Net app, you can configure IIS to "Enable 32-bit app" on the application pool for our webapp, so it will emulate 32-bit.

So, the final question is "Depends"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.