Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下问题:
我的 .NET 程序集是在 x86 模式下编译的。我还能在 x64 Windows 系统上利用 NGEN 的性能优势吗?x86 程序集会在 x64 上编译为本机代码吗?
使用 x86 编译的程序集将在 64 位系统上运行 i wow64,但使用 AnyCPU 编译的程序集将在本机运行,而与 NGEN 无关。为 x86 编译的程序集可以在 64 位系统上加载 32 位程序集,为 AnyCPU 编译的代码不会加载 32 位 dll。
当您使用 NGEN 时,您将避免程序集的 JIT 编译,并且当在 x64 系统上使用 x86 编译时,程序集将是本机 x86 代码。