我的进程配置为作为Windows服务运行。
转储显示32位,ILSply和任务管理器显示64位。
谁是对的?我假设,由于将IL设置为AnyCPU,将其编译为“ AnyCPU”,因此当OS真正执行进程时,JIT将根据其对OS本身的知识(64/32等)来决定编译哪个平台。 )
/ dumpbin / headers文件名:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>dumpbin /headers D:\MYAPP.exe
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file D:\MYAPP.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
14C machine (x86)
3 number of sections
5BD07758 time date stamp Wed Oct 24 09:44:56 2018
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
122 characteristics
Executable
Application can handle large (>2GB) addresses
32 bit word machine
但是当我打开任务管理器并选择Platform时,我看到它以64Bit运行。
当我在 ILSpy 中打开exe时,会看到以下内容:
// Global type: <Module>
// Entry point: MyAPP.WindowsService.Program.Main
// Architecture: AnyCPU (64-bit preferred)
// Runtime: .NET 4.0