Forum Discussion
Aug 30, 2018
The trouble with "bitness" (aka architecture) and shiming.
I want to highlight an issue with implementing PSF shimming that I ran into. It was particularly annoying because the symptoms did not match the real problem. The issue is the need for alignment...
Dan Gough
Feb 07, 2020Brass Contributor
TIMOTHY_MANGAN you can use corflags.exe from the Windows SDK to determine if an app is AnyCPU btw:
https://stackoverflow.com/questions/18608785/how-to-interpret-the-corflags-flags
CPU Architecture PE 32BITREQ 32BITPREF ------------------------ ----- -------- --------- x86 (32-bit) PE32 1 0 x64 (64-bit) PE32+ 0 0 Any CPU PE32 0 0 Any CPU 32-Bit Preferred PE32 0 1
Feb 07, 2020
Dan Gough Well, I do that in PsfTooling to know which components to install, but it gets more complicated too.
In AnyCPU, the dev can specify what the default should be - this affects how the AnyCPU will run if on an x64 machine. Visual Studio used to default this default setting x64, but now defaults to x86. But then it isn't just the file because we also have a GPO for the target system that can override that default!
Ultimately I resolved the PsfMonitor issue by changing away from AnyCPU and the PSF now builds bitness specific versions of that component too.