.net - How are explicit interface implementations implemented in IL? -


I have a look at implementing a clear interface in IL in the following class the interface IA is the method () , but the method method :

  public class B: IA object IA.Method () {/ * code * / }}  

The following IL method has been compiled from the signature:

  .method private hidebysig newslot virtual last example object IA.Method () cil managed { .override IA :: method / * code * /}  

My question is - why in The name of the method is IL IA.Method () , instead of just the method ? What does this really mean, and it's not working if it's gone? I can not find anything about this in ECMA Speak or Google.

That's because a method can be many times in this way.

  public class B: IA {object method () {} object IA.Method () {}}  

The first is a normal way to implement the second interface You could not have both without prefix because you can not distinguish between them.

  New B () Method (); // Common method calls (IA) new B ()). Method (); // calls the IA interface method  

Comments