2

I'm trying to read some XML, and I'd like to return all the child elements of the 'all' element. I have this code:

    var xmlFile = XDocument.Parse(responseText);

    var elements =
        from el in xmlFile.Elements("all")
        select el;

But I'm getting the error:

15:15 08/03/2017 Error : Script (C#.net Script): error CS1935: Could not find an implementation of the query pattern for source type 'System.Collections.Generic.IEnumerable'. 'Select' not found. Are you missing a reference or a using directive for 'System.Linq'?

I've included using System.Linq at the top of my project but that doesn't seem to help.

Is there another way to fix this?

Luke4792
  • 455
  • 5
  • 19

1 Answers1

3

Check if your Project references System.Core.

This is a known problem if are trying to use LINQ with .net 2.0.