The Drop-down lists of the target components of different platforms are observed first through experiments. In Visual Studio, adjust Platformtarget to any CPU, x86, and x64, compiled into EventPingPongAny.exe, EventPingPongX86.exe, respectively, EventPingPongX64.exe three assemblies.
Using the CorFlags Eventpingpong*.exe method to check the related properties, the results are as follows:
H:\lab\eventpingpong\bin>corflags EventPingPongAny.exe
Microsoft (R). NET Framework corflags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
version:v2.0.50727
CLR header:2.5
Pe:pe32
Corflags:1
Ilonly:1
32bit:0
signed:0
H:\lab\eventpingpong\bin>corflags EventPingPongx86.exe
Microsoft (R). NET Framework corflags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
version:v2.0.50727
CLR header:2.5
Pe:pe32
Corflags:3
Ilonly:1
32bit:1
signed:0
H:\lab\eventpingpong\bin>corflags EventPingPongx64.exe
Microsoft (R). NET Framework corflags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
version:v2.0.50727
CLR header:2.5
pe:pe32+
Corflags:1
Ilonly:1
32bit:0
signed:0
To change the target platform of a program that compiles to any CPU to qualify x86, you can use the following directive:
corflags/32bit+ EventPingPongAny.exe
Changing the parameter to/32bit-can be restored back to any CPU. As for the pure x64 target platform program because of PE different (for pe32+, with any CPU, x86 different), so can not directly use corflags switch, must recompile.