I develop my application for 32 bit and 64 bit Windows. I have a problem: If my application is launched from a 32-bit process on 64-bit OS, my application will run as 32-bit. How I can re-run my C# AnyCPU application as 64 bit, if it's running as 32 bit (WOW64)?
Asked
Active
Viewed 2,779 times
2
-
select the AnyCPU option and you are good to go – David Heffernan Jun 07 '11 at 13:42
-
No, I'm bad to go =) I want to my application running on x64 only as 64 bit, on x86 only as 32 bit. – Aleksandr Vishnyakov Jun 07 '11 at 13:43
-
You could explicitly set the "Platform Target" to x64 under Properties -> Build. – Brandon Moretz Jun 07 '11 at 13:43
-
Why? What is the problem? How is the app being started? – Ian Ringrose Jun 07 '11 at 13:44
-
1If you select AnyCPU then it will run as a 64 bit process on 64 bit OS. – David Heffernan Jun 07 '11 at 13:45
-
AnyCpu EXE should be 32 bit on 32 bit windows and 64 bit on 64 bit windows. Maybe you can post the contents of your project file so we can see it. – Richard Brightwell Jun 07 '11 at 13:47
-
@David If my application is launched from a 32-bit process on 64-bit OS, my application will run as 32-bit. – Aleksandr Vishnyakov Jun 07 '11 at 13:47
1 Answers
7
If it is a Windows application, then you can launch it from a 64-bit command window. You can find the 64-bit version of cmd.exe here: c:\windows\system32\cmd.exe (note, the 32-bit version is in c:\windows\SysWOW64\cmd.exe).
If it is a web application, then you need to set the identity of the application pool to 64-bit.

Philipp Schmid
- 5,778
- 5
- 44
- 66
-
Thanks! In my program I can use runas from System32/SysWOW64, too. – Aleksandr Vishnyakov Jun 07 '11 at 13:54