I have two assemblies: A and B. I have InternalsVisibleTo for B. I would like to make calls from A to get information that can only be known by the type defined in B, so that internal things are stored. I can do this using the internal interface defined in and explicitly implemented in B.
Assembly A
internal interface IHasData
{
Data GetData();
}
class ClassA
{
DoSomething(IHasData);
}
Assembly B
public abstract class ClassB : IHasData
{
Data IHasData.GetData() { }
}
The problem arises when someone refers to assembly B and receives from ClassB - they get an error: "The type" AssemblyA.IHasData "is defined in the assembly that is not referenced," although this type should be invisible to them. If I look at the definition of an open type, I see what I expect - ClassB without interfaces.
? B. IHasData ClassB, A. - , ?