title: C# Use a class that implements an interface without adding a reference to the assembly that defines the interface
body: <p>I have 3 assemblies written in C#, namely A.exe, B.dll, C.dll</p>
  
  <ul>
  <li>C.dll defines a public interface IfaceC.</li>
  <li>A.exe defines a public class ClassA : IfaceC</li>
  <li>B.dll uses ClassA but does not make explicit use of IfaceC</li>
  </ul>
  
  <p>My question: is it possible to compile B <strong>without</strong> referencing C.dll ? I do not use it and I want to prevent a developer from using it (i.e. typing "IfaceC" in the B's code accidentally). However A.exe still needs it.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Given my archi, A can reference C but not B, C cannot reference nor A neither B, B can reference A <strong>but not (if possible) C</strong></p>