相同点

两者都有:manifest、metadata、IL

 

不同点

1、assembly 有main程序函数。module只能附属于程序集,程序集可以拥有多个。

2、metadata的差异

程序集特有的部分:无论是DLl或EXE都有自生程序集描述的部分,而模块没有。这个包含程序集版本 公钥 等信息。这就程序集和模块根本性不同的地方,模块由于没有这一部分信息所以无法被程序直接加载。

Assembly
-------------------------------------------------------
    Token: 0x20000001
    Name : Main
    Public Key    :
    Hash Algorithm : 0x00008004
    Version: 0.0.0.0
    Major Version: 0x00000000
    Minor Version: 0x00000000
    Build Number: 0x00000000
    Revision Number: 0x00000000
    Locale: <null>
    Flags : [none] (00000000)
    CustomAttribute #1 (0c000001)
    -------------------------------------------------------
        CustomAttribute Type: 0a000001
        CustomAttributeName: System.Runtime.CompilerServices.CompilationRelaxationsAttribute :: instance void .ctor(int32)
        Length: 8
        Value : 01 00 08 00 00 00 00 00                          >                <
        ctor args: (8)

    CustomAttribute #2 (0c000002)
    -------------------------------------------------------
        CustomAttribute Type: 0a000002
        CustomAttributeName: System.Runtime.CompilerServices.RuntimeCompatibilityAttribute :: instance void .ctor()
        Length: 30
        Value : 01 00 01 00 54 02 16 57  72 61 70 4e 6f 6e 45 78 >    T  WrapNonEx<
                      : 63 65 70 74 69 6f 6e 54  68 72 6f 77 73 01       >ceptionThrows   <
        ctor args: ()

    CustomAttribute #3 (0c000003)
    -------------------------------------------------------
        CustomAttribute Type: 0a000003
        CustomAttributeName: System.Diagnostics.DebuggableAttribute :: instance void .ctor(value class DebuggingModes)
        Length: 8
        Value : 01 00 07 01 00 00 00 00                          >                <
        ctor args: ( <can not decode> )

 

编程是个人爱好