a blog for those who code

Thursday 26 June 2014

System.Collections.Generic.IEnumerable does not contain any definition for 'ToList'

You might be getting this error 'System.Collections.Generic.IEnumerable' does not contain any definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?).

The solution is in this error itself i.e. "are you missing a using directive". Yes you are missing System.Linq. You have to add using System.Linq to get access to the ToList() function on the current code file.


  1. I was able tо fіnd gooⅾ advice from youг ⅽontent.

  2. C'est la rentrée de toutes vos séries TV préférées !

  3. Great service of online buy cheap pro jerseys,and enjoy our cheap jersey 2012 79% off.