Do you gmcs compiler? mcs does not seem to compile code containing Linq.
$ cat a.cs using System; using System.Linq; class Test { static void Main() { foreach (var i in new int[] { 1, 2, 3, 4, 5}.Where(n => n % 2 == 0)) { Console.WriteLine(i); } } } $ gmcs a.cs $ ./a.exe 2 4
To compile with gmcs , follow these instructions described in MonoDevelop Frequently Asked Questions :
Is it possible to compile my project using gmcs?
Yes. Right-click on your project, select "Options" → "Runtime" and select "2.0" from the drop-down list.
Mark Rushakoff Apr 27 '10 at 2:05 april 2010-04-27 02:05
source share