1

I create a new C# Console application and there is only one line of code in Main method

Console.ReadKey();

When I build the project with Any CPU platform, the application runs as 32-bit application. (I check this in Task Manager and SigCheck tool). When I build the project with x64 platform, the application runs as 64-bit application.

My question is why the "any cpu" application does not run as 64-bit application in Windows x64.

System: Windows 8.1 x64, Visual studio 2015, .Net framework 4.5.2

Ha Pham
  • 373
  • 3
  • 18
  • 2
    There is a flag "prefer 32-bit" in Project Properties, if you uncheck it, the program will run 64 bit – Matteo Umili Dec 22 '16 at 08:45
  • http://blogs.microsoft.co.il/sasha/2012/04/04/what-anycpu-really-means-as-of-net-45-and-visual-studio-11/ – Aron Dec 22 '16 at 08:46
  • @Matteo Umili: Problem is that app runs in 32 bit even when I set false in csproj file. – Ha Pham Dec 22 '16 at 09:24
  • @Fanliver Have you rebuilt the project? Why don't you edit it using the IDE? – Matteo Umili Dec 22 '16 at 10:28
  • Yes. I have rebuilt my project by Visual Studio 2015. With printing value of Environment.Is64BitProcess, I got the result "true". But When I used Sigcheck tool (https://technet.microsoft.com/en-us/sysinternals/bb897441.aspx) to check, it always returned 32-bit for Machine Type. – Ha Pham Jan 06 '17 at 06:47

0 Answers0