title: CS0411: The type arguments for method X cannot be inferred from the usage when building with TeamCity
body: <p>This is a long shoot but I have run out of own ideas.</p>
  
  <p>Recently my TeamCity builds have started to throw this error upon me: </p>
  
  <blockquote>
    <p>File.cs(Row, Col): error CS0411:
    The type arguments for method
    'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable,
    System.Func)' cannot be inferred from
    the usage. Try specifying the type
    arguments explicitly.</p>
  </blockquote>
  
  <p>But there are no errors in my code (or project configuration).</p>
  
  <p>It compiles just fine if I do it either from withing Visual Studio (2010) itself or using MSBuild just as the build agent would do. (Even on the build machine.)</p>
  
  <p>Just for reference, the code looks something like this:</p>
  
  <pre><code> public ISet&lt;Task&gt; Tasks {get; set;}
  
   public IEnumerable&lt;GradedTask&gt; FindGradedTasks(){  
      return Tasks.Select(GetResult).Where(t=&gt;t.HasResult).ToList(); // error   
   }
  
   public GradedTask GetResult(Task task) {  
      return new GradedTask(this, task);  
   }
  </code></pre>
  
  <p>Anyone seen anything like this before?
  What might be causing this behaviour?</p>