O
Object01
We're working with some benchmarks designed to test x86 vs. x64
performance (both on a x64 system). To ensure that our assemblies are
loaded as x86 or x64, we specifically target our builds to the
appropriate platform, avoiding using the "Any CPU" setting. (It's my
understanding that on an x64 system, the runtime will JIT an "Any CPU"
assembly as x64 if it's able.)
All this raised an interesting question: given an arbitrary .NET
assembly, how can I tell how it was compiled? ILDASM shows me the PE
header, and I've found sections labeled "PE Optional Header (64 bit)"
in assemblies specifically targeted to x64. But assemblies targeted
to "Any CPU" -and- assemblies targeted to x86 seem to have "PE
Optional Header (32 bit)", leaving some ambiguity. Is there a sure-
fire way to tell? A flag among all that hex, perhaps?
performance (both on a x64 system). To ensure that our assemblies are
loaded as x86 or x64, we specifically target our builds to the
appropriate platform, avoiding using the "Any CPU" setting. (It's my
understanding that on an x64 system, the runtime will JIT an "Any CPU"
assembly as x64 if it's able.)
All this raised an interesting question: given an arbitrary .NET
assembly, how can I tell how it was compiled? ILDASM shows me the PE
header, and I've found sections labeled "PE Optional Header (64 bit)"
in assemblies specifically targeted to x64. But assemblies targeted
to "Any CPU" -and- assemblies targeted to x86 seem to have "PE
Optional Header (32 bit)", leaving some ambiguity. Is there a sure-
fire way to tell? A flag among all that hex, perhaps?