title: when project needs reference to other dlls
body: <p>I encountered strange behavior and don't know the reason. I have two projects A and B. A references System.Web assembly and B references A. I add using statement to projects B class <code>using A</code>. It works fine until I start using linq statements. <strong>I get compilation error</strong>:</p>
  
  <pre><code>The type 'System.Web.UI.Control' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
  </code></pre>
  
  <p>Simplified example project. Two projects Parent and Child. Parent project references System.Web. Child project references Parent project.
  Parent project contains one class Parent:</p>
  
  <pre><code>using System.Web.UI;
  
  namespace Parent
  {
      public static class Parent
      {
          public static T DoStuff&lt;T&gt;(this object obj)
              where T : Control 
          {
              return null;
          }
      }
  }
  </code></pre>
  
  <p>Child project contains one class Child:</p>
  
  <pre><code>using System.Collections.Generic;
  using System.Linq;
  using Parent;
  
  namespace Child
  {
      public class Child
      {
          void Test()
          {
              var strings = new List&lt;string&gt;();
              var string1 = strings.FirstOrDefault();
          }
      }
  }
  </code></pre>
  
  <p>Exception is thrown on <code>var string1 = strings.First();</code>. I would just add reference to System.Web in Child project and everything works fine. But I would like to understand why it works like this.
  If I change parent class to:</p>
  
  <pre><code>public static class Parent
  {
      public static Control DoStuff(this object obj)
      {
          return null;
      }
  }
  </code></pre>
  
  <p>Instead of using generics I use Control class directly. And it works fine.
  Any ideas?</p>
  
  <p>edited: <code>var string1 = strings.FirstOrDefault();</code></p>