0

I am using Visual Studio 2012 in a Windows 7 machine. I7 processor.

I have a Managed C++/CLI library. The project also references a Native C++ static library. I have everything configured for x86.

However when I build, if I check the resulting dll with CorFlags it says:

PE: PE32

CorFlags: 24

ILONLY: 0

32BIT: 0

Signed: 1

According to this post it means that my dll is for AnyCPU? I tried to find more documentation on how to interpret the flags, but I didn't find anything different.

I am confused, If I built with the Platform configured to "x86", shouldn't the 32Bit flag be 1?

Am I missing some additional configuration?

Community
  • 1
  • 1
Dzyann
  • 5,062
  • 11
  • 63
  • 95

1 Answers1

4

It is a bit of a quirk for mixed-mode assemblies. The ILONLY flag is dominant here. With it set to 0, it tells the CLR that the assembly contains more than MSIL, it also contains machine code. That blows the relevance of the 32BIT option, the assembly can only ever work if the bitness of the process agrees with the bitness of the machine code in the file.

Which is set by the executable header, IMAGE_FILE_HEADER.Machine determines that. Like it does for any executable file that contains machine code. Corflags doesn't display it, you can see it with dumpbin.exe /headers

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Thanks, with that I could check I was building things correctly. In the "File Header Values" in the "machine" label as you said, it said x86 or x64 depending on my build configuration. – Dzyann Feb 26 '14 at 20:19