As shown in the code below, there are two interfaces IFoo
defined in two different assemblies:
/// assembly A
interface IFoo {
void DoSomething()
}
/// assembly B
interface IFoo {
void DoSomething()
void DoSomethingElse()
}
/// assembly C
class Bar : IFoo {
public virtual void DoSomething()
public virtual void DoSomethingElse()
}
Assuming assembly A and assembly B mistakenly have the same signature (either assembly weak name or strong name). Will the generated MSIL for class Bar
be different depending on whether assembly A or assembly was used during build time?
In other words, suppose we build a project with assembly A and C at run time, is it okay to replace A with assembly B at run time? Or I will get exceptions like "IFoo.DoSomethingElse" is not implemented because during build process DoSomethingElse
is considered a new method as opposed to implementing an existing method in the interface.