views:

293

answers:

2

Dear Gurus

I would like to know that If my console Application is

  • running in debug mode attached in
  • Visual Studio 2008 of 32bit
  • while my machine is 64bit with Win Srv 2008 64bit
  • and .Net framework 64 is installed as well

Is my application is working in 64bit or not if not how can i make it run in 64bit?

+4  A: 

Yes, if you compiled the application with target "Any CPU" (or "x64"), then it will run in 64 bit mode.

Visual Studio only comes in a 32 bit version, but it doesn't have any problem debugging a 64 bit application.

Guffa
+1  A: 

If you're compiling to the "Any CPU" target then your app is running in 64bit.
One way you can tell is that while debugging "Edit and continue" is disabled for 64bit apps, and you'll see that message if you try it.

So, some facts
The debugger can debug 64bit apps. VS2008 only comes in 32bit, there is no 64bit version.

You can specifically target the 64 CPU by changing your Build Target to 64bit, your application will no longer work on 32bit CPU's.

You can specifically target 32bit CPUs, and your application will continue to work on 64bit machines.

Also, when building, it's actually only really important what target your Exe's are compiled to. DLL's compiled to Any CPU will take their platform lead from what ever the loading exe is.

Hope this helps.

Binary Worrier
Thanks hint regarding "Edit and Continue" made me select this as an answer :)
Mubashar Ahmad
Note that checking that "Edit and continue" is disabled is no guarantee that the application is running in 64 bit mode. It can also be disabled in the options.
Guffa
Guffa: Good point, so ensure "Edit and continue" is switched on first :)
Binary Worrier
@Guffa: What if editing while running says "64 bits app can't be modify while running" :):)
Mubashar Ahmad
@Mubashar: Yes, if the message specifically states that this is the exact reason.
Guffa