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.

4 comments:

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

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

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

    ReplyDelete
  4. Hey there! This is kind of off topic but I need some
    advice from an established blog. Is it very difficult to set up your own blog?
    I'm not very techincal but I can figure things out
    pretty quick. I'm thinking about creating my own but I'm not sure where to start.
    Do you have any points or suggestions? With thanks

    ReplyDelete