The transition from 32-bit to 64-bit development requires clarification regarding the infrastructure and the .NET platform.

Short reference information. I am developing C # in VS2008 under .net 3.5 on a Vista-x64 machine.

I recently switched to Vista-x64, and after some searching, I still feel that I don’t quite understand the interaction between the OS and the .net infrastructure. I would like to receive some corrections / clarifications regarding this.

The following is my understanding of the development process (please correct if I am wrong):

When I set up my project, I can install the target platform: x64, x86, AnyCpu. As far as I understand, AnyCpu will be targeting the current platform (in my case x64). I can also configure x86 and execute it (due to WoW64).

I assume that when I target x64, the program will use the 64-bit .net framework 3.5 and a similar 32-bit environment for x86. Is it correct?

What bothers me, when I am targeting x64 and printing out platform information, it prints " WIN32NT ". This makes me think that " WIN32NT " is not the way I think, but I could not learn much about it. What is it?

ComputerInfo computerInfo = new ComputerInfo();
Console.WriteLine("{0,-30}:\t{1}", "Platform", computerInfo.OSPlatform);

Thanks.

+3
source share
4 answers

It really doesn't help, but all environments return win32nt ... it would be useful if they returned win64nt, right?

Do you find any other problems? Or are you just looking for knowledge here?

IntPtr. , 64 ( )

http://msdn.microsoft.com/en-us/library/system.intptr.size.aspx

http://blogs.msdn.com/kstanton/archive/2004/04/20/116923.aspx

+5

AnyCPU - AnyCPU "native" . 32- , 32 , 64- , 64 .

32 64 . , . , SQLITE . , AnyCPU, 32- , 64- . , Sqlite 32 . .net 32 64- .

x86 ( , 64 ). , 32- 64- Windows.

AnyCPU, , , .

, , , . , , x64, . run-off-the-mill.net , . , IntPtr, .

+4

AnyCpu . , . JIT, , IL 32- 64- , . , .Net, AnyCpu, 32, 64- .

+3

IIRC, Win32 Windows API, Win32NT - API/ Windows, Windows NT. Windows 95 Win32NT, API NT 9x , . , Win32NT API x86, x64 ( Itanium, x64).

Since the advent of 64-bit, Windows 32 no longer refers to the processor architecture or the size of pointers. (In fact, Win32 also worked on Alpha machines in the early days, so Win32 definitely does not mean Windows for x84.)

If you want to know if you are at 32 or 64 bit, you can set the IntPtr size with

IntPtr.Size // 4 when running as x84, 8 when running on x64 or Itanium

Although, strictly speaking, this is not quite what you requested.

+3
source

Source: https://habr.com/ru/post/1720324/


All Articles