64 .NET编译/ Process Explorer的怪胎怪胎、NET、Explorer、Process

2023-09-04 10:48:33 作者:游吟诗人

道歉,如果任何的就是我要说的话是没有意义的,或俯瞰明显的东西 - 我的CLR内部的知识参差不齐

Apologies if any of what I'm about to say makes no sense or overlooks something obvious - my knowledge of CLR internals is spotty.

如果我理解正确的话,那么如果我只是建立在VS2K5'值为anycpu溶液(或点的MSBuild在这些设置.sln文件),那么这些二进制文件只编译据MSIL。然后,他们得到即时编译为32位,如果如果在x64上执行的执行在32位平台或64位code,对吧?

If I understand correctly, then if I just build a solution for 'AnyCPU' in VS2K5 (or point MSBuild at that .sln file with those settings) then the binaries only compile as far as MSIL. They then get JITted to 32-bit if executed on a 32-bit platform or 64-bit code if executed on x64...right?

这些DLL用于Web应用程序和托管在W3WP.exe进程。 Process Explorer的告诉我W3WP是一个64位进程。

The DLLs are used for a web app and hosted in the W3WP.exe process. Process Explorer tells me W3WP is a 64-bit process.

但是,当我使用Process Explorer来对这些DLL的DLL查看一个检查的属性,它说:图片:32位。是什么给了?

But when I use Process Explorer to check the properties on one of these DLLs in DLL view, it says: 'Image: 32-bit'. What gives?

如果我运行针对有问题的DLL corflags它告诉我:ILONLY 1,32BIT 0,但PE PE32。我的理解是,这意味着是的,它被编译只到IL,没有它不限制为32位或64位,但我并不完全清楚。是PE32标志任何与它显示为32位按上面?

If I run corflags against the dll in question it tells me: ILONLY 1 , 32BIT 0 but PE PE32 . My understanding is that this means yes it is compiled only as far as IL, no it's not limited to either 32 bit or 64 bit, but I'm not entirely clear. Is the PE32 flag anything to do with it showing up as 32-bit as per above?

推荐答案

您的问题是有关this问题。你们看到的Process Explorer的是图像的类型,不同的是在大会 corflags规定的运行时的兼容性式的。

Your question is related to this question. What you are seeing in process explorer is the type of image, which is different of the "runtime compatibility" type specified in the assembly's corflags.

设置为任何CPU的要点是最给力的共同点在这两个原生图像和组装,因此,它可以让Windows的引导程序的.NET选择什么样的运行时间将是最适合当前平台。

The point of setting "Any Cpu" is to force the most common denominator in both the native image and the assembly, so that it lets the windows bootstrapper for .NET choose what kind of Runtime will be the most appropriate for the current platform.

所以,你的例子,你有一个32位的图像(具体由PE头),包含任何CPU组件(如指定的CorFlags的组装)。

So, for your example, you do have a 32 Bits image (as specified by the PE Header), containing an "Any CPU" assembly (as specified by the CorFlags for the assembly).