先通過實驗觀察不同平臺目標(biāo)組件的下拉列表。在Visual Studio中依序調(diào)整PlatformTarget為Any CPU, x86及x64,分別編譯成EventPingPongAny.exe, EventPingPongX86.exe, EventPingPongX64.exe三個程序集。
再使用corflags EventPingPong*.exe的方法檢查相關(guān)屬性,得到結(jié)果如下:
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
若要將編譯成Any CPU的程序目標(biāo)平臺改為限定x86,可使用以下指令:
CorFlags /32BIT+ EventPingPongAny.exe
將參數(shù)改為/32BIT-則可以再還原回Any CPU。至于純x64目標(biāo)平臺的程序由于PE不同(為PE32+,與Any CPU, x86不同),故無法直接使用CorFlags切換,必須重新編譯。
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com