Method binding to base method in external library can't handle new virtual methods “between”

后端 未结 2 1695
闹比i
闹比i 2021-02-08 12:27

Lets say I have a library, version 1.0.0, with the following contents:

public class Class1
{
    public virtual void Test()
    {
        Console.WriteLine( \"Li         


        
2条回答
  •  清歌不尽
    2021-02-08 13:14

    When I build the executable with the first version of the library (I named mine "Thing"), and disassemble it I get:

    L_000d: call instance void [Thing]Thing.Class1::Test()
    

    Rebuilding it with the new DLL referenced:

    L_000d: call instance void [Thing]Thing.Class2::Test()
    

    So that confirms the decision to which method is referred to is made compile-time.

提交回复
热议问题