Try adding a reference to the System.Core assembly to your project. Most of the classes in the System.Linq namespace are in this assembly.
If this does not work, you can also try adding a link to System.Data.Linq .
And in the future, do not underestimate the usefulness of error messages provided by the compiler. Yes, sometimes they are mysterious, and sometimes they are even misleading. But they are certainly a good place to start when you are trying to understand why something will not compile, what you expected to work.
source share