title: Hiding an internal interface in a "friend" assembly
body: <p>I have two assemblies: A and B.  A has InternalsVisibleTo set for B.  I would like to make calls from A to get information that can only be known by a type defined in B in a way that keeps things internal.  I can do this using an internal interface defined in A and implemented explicitly in B.  </p>
  
  <p><strong>Assembly A</strong></p>
  
  <pre><code>  internal interface IHasData
    {
      Data GetData();
    }
  
    class ClassA 
    {
      DoSomething(IHasData);
    }
  </code></pre>
  
  <p><strong>Assembly B</strong></p>
  
  <pre><code>  public abstract class ClassB : IHasData
    {
      Data IHasData.GetData() { /** do something internal **/ }
    }
  </code></pre>
  
  <p>The trouble comes when someone references assembly B and derives from ClassB - they get the error: "The type 'AssemblyA.IHasData' is defined in an assembly that is not referenced" even though that type should be invisible to them.  If I look at the public type definition I see what I expect - ClassB with no interfaces implemented.</p>
  
  <p>Why do I get this error?  All of the implementation is in assembly B.  I could use IHasData internally in ClassB and that wouldn't require assembly A to be referenced.  Can someone help me understand what is going on?</p>