views:

595

answers:

6

If I want to compile my .NET applications for a 64 bit environment. Do I need

  • 64 bit OS version
    or
  • 64 bit Visual Studio version
    Or both?
A: 

You also need a 64 bit CPU.

Vaibhav
A: 

This should have all you need:

http://msdn.microsoft.com/en-us/library/ms241066.aspx

I'd start though, by installing a 64-bit OS (which obviously must be running on a 64-bit CPU!).

Bob King
And then virtualizing a 32-bit os to be thorough in testing.
hometoast
+8  A: 

You actually need neither of those for building the application. A pure .NET 2.0+ application will -- in the absence of specific compiler flags to the contrary -- run as a 64-bit application under a 64-bit OS and as a 32-bit application under a 32-bit OS.

Edit: Also, there's no such thing as a 64-bit version of Visual Studio.

Curt Hagenlocher
You're right. It's all handled by JIT MSIL compiler.
Jakub Kotrla
Thank you. deleted my post. adding the link as a comment here for native apps - Use Visual Studio to build 64-bit native application (http://blogs.msdn.com/tolong/archive/2007/03/21/use-visual-studio-to-build-64-bit-application.aspx)
Gulzar
+1  A: 

I'm running Visual Studio 2005 on a 32-bit machine at work and under the Build section in my Project Properties, I can select x64 as my platform target.

So I don't think you need either a 64-bit OS or a special version of VS.

Dana
+2  A: 

Actually you don't need anything, since .NET applications are compiled to CIL. The virtual machine compiles the CIL to native code at run-time. So if you run your application on 64-bit platform, it will generate native 64-bit code, but if you run it on a 32-bit platform, it'll generate 32-bit code.

However, if you want to debug / profile / test your application in a 64-bit environment, then you need:

  • 64-bit OS
  • 64-bit .NET VM

Visual Studio can debug applications running in 64-bit mode. For profiling you're likely to need a 64-bit profiler.

KovBal
A: 

Java started this and it was very good. .NET has taken it further. Platform independence that is.

Andrei Rinea