显示上面包车型大巴音信,CorFlags.exe不但可查询.NET组件的平台目的设定

Version   : v2.0.50727

  1. 查阅上边的表,来支配是还是不是为32,64依然anycpu:
    anycpu: PE = PE32 and 32BIT = 0
    x86: PE = PE32 and 32BIT = 1
    64-bit: PE = PE32+ and 32BIT = 0

https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference

ILONLY    : 1

使用CorFlags.exe来观察dll的header信息:

/verbosity:level

Specifies the amount of information to display in the build log. Each
logger displays events based on the verbosity level that you set for
that logger.

You can specify the following verbosity levels: q[uiet], m[inimal],
n[ormal], d[etailed], and diag[nostic].

The following setting is an example: /verbosity:quiet

 

Version   : v2.0.50727

  1. 打开 Visual Studio command prompt.

  2. 输入 “CorFlags.exe [Assembly File Path]“.

  3. 显示上边包车型客车音信:
    Microsoft (R) .NET Framework CorFlags Conversion Tool. Version
    4.0.30319.1
    Copyright (c) Microsoft Corporation. All rights reserved.

/nologo 

Don’t display the startup banner or the copyright message.

 

 

PE        : PE32

Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 1
ILONLY : 1
32BIT : 0
Signed : 0

切换路径

cd ‘C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\15.0\Bin\’

 

PS C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\15.0\Bin> .\MSBuild.exe
/version
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.3.409.57025

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version 
4.0.30319.1

翻开版本

PS C:\Program Files\PowerShell\6.0.0-beta.6> msbuild /version
Microsoft (R) Build Engine version 4.6.1590.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

4.6.1590.0

 

PS C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\15.0\Bin> .\MSBuild.exe
/version
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.3.409.57025

32BIT     : 1

CorFlags  : 1

CorFlags  : 1

CLR Header: 2.5

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version 
4.0.30319.1

PE, CorFlags, IONLY,
32BIT等本性的意义能够参见那篇文章。若要将编写翻译成Any
CPU的次第目的平台改为限定x86,可应用以下指令:

Signed    : 0

Signed    : 0

 

CorFlags /32BIT+ EventPingPongAny.exe

PE        : PE32

 

CLR Header: 2.5

 

Copyright (c) Microsoft Corporation.  All rights reserved.

 

.NET Framework SDK中的1个工具程序:
CorFlags.exe。CorFlags.exe不但可查询.NET组件的阳台指标设定,甚至能间接修改设定,省去重新编写翻译的工夫。

ca88亚洲城网站, 

ILONLY    : 1

先通过实验观望分歧平台指标组件的下拉列表。在Visual
Studio中依序调整PlatformTarget为Any CPU,
x86及x64,分别编写翻译成伊夫ntPingPongAny.exe, 伊夫ntPingPongX86.exe,
伊夫ntPingPongX64.exe两个程序集。

再使用corflags EventPingPong*.exe的法门检查相关属性,获得结果如下:

CorFlags  : 3

Copyright (c) Microsoft Corporation.  All rights reserved.

H:\Lab\EventPingPong\bin>corflags EventPingPongx86.exe

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version 
4.0.30319.1

ILONLY    : 1

H:\Lab\EventPingPong\bin>corflags EventPingPongAny.exe

Signed    : 0

H:\Lab\EventPingPong\bin>corflags EventPingPongx64.exe

Version   : v2.0.50727

 

CLR Header: 2.5

 

PE        : PE32+

将参数改为/32BIT-则足以再还原回Any
CPU。至于纯x64对象平台的次序由于PE分歧(为PE32+,与Any CPU,
x86不比),故无法直接采取CorFlags切换,必须另行编写翻译。

32BIT     : 0

32BIT     : 0

Copyright (c) Microsoft Corporation.  All rights reserved.

相关文章