Bug 12082 - Editor does not recognize Linq methods but project can be build and run
Summary: Editor does not recognize Linq methods but project can be build and run
Status: RESOLVED INVALID
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 4.0.4
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.0.9 (from master)
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-05-02 18:55 UTC by David Koontz
Modified: 2013-06-24 16:18 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Example solution that produces the issue (7.88 KB, application/zip)
2013-05-02 18:55 UTC, David Koontz
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description David Koontz 2013-05-02 18:55:04 UTC
Created attachment 3910 [details]
Example solution that produces the issue

I created a brand new console C# project.  I added the following code as the test case (also attached as a solution).

using System;
using System.Linq;

namespace LinqProblemTest {
	class MainClass {
		public static void Main(string[] args) {
			var nums = new [] { 1, 2, 3, 4, 5, 6, 7, 8 };
			nums.Select(n => n * 2).ToList().ForEach(Console.WriteLine);
		}
	}
}

The using System.Linq line is in red with the message "Unknown resolve error".  Also the nums.Select(n => n * 2).ToList().ForEach(Console.WriteLine) line has the message "error CS0117: `System.Int32[]' does not contain a definition for `Select'"

If I build and run, this project runs just fine, only the editor is unable to resolve Linq (or maybe is having a hard time with extension methods?).
Comment 1 Mikayla Hutchinson [MSFT] 2013-05-02 19:09:49 UTC
You probably need a reference to System.Core.
Comment 2 David Koontz 2013-05-02 22:26:17 UTC
Right you are.
Comment 3 PJ 2013-06-24 16:18:53 UTC
This bug was marked as fixed for Xamarin Studio 4.0.9, which is currently in the beta channel. Try it out!