How to use LINQ in Mono?

Jader Dias picture Jader Dias · Apr 27, 2010 · Viewed 26.8k times · Source

I can't make System.Linq (aka LINQ to Objects) work. I am running MonoDevelop 2.2.1 in Ubuntu 10 Lucid Lynx with Mono 2.4.4.

They advertise in their site that they implemented LINQ, but I can't even find Enumerable.Range or ToArray(). What's wrong?

Answer

serge_gubenko picture serge_gubenko · Apr 27, 2010

I guess what you would need to do is:

  1. In your project options set "Runtime version" to "Mono/.Net 3.5"
  2. Add reference to System.Core package (right click references in solution explorer)
  3. Add "using System.Linq" to your module

after that your code should compile and execute

hope this helps, regards