Bug 15008 - Linq support in MonoTouch (Xamarin.IOS on OSX)
Summary: Linq support in MonoTouch (Xamarin.IOS on OSX)
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core ()
Version: master
Hardware: Macintosh Windows
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
: 15089 16698 ()
Depends on:
Blocks:
 
Reported: 2013-09-26 05:40 UTC by Lucian POPESCU
Modified: 2014-03-07 09:42 UTC (History)
9 users (show)

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


Attachments
System.MissingMethod exception (31.88 KB, image/jpeg)
2013-09-26 05:40 UTC, Lucian POPESCU
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 GitHub or Developer Community 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 FIXED

Description Lucian POPESCU 2013-09-26 05:40:08 UTC
Created attachment 4993 [details]
System.MissingMethod exception

Hi,

I have an MvvmProject targeting mobile platforms, that uses Linq to query the database. Since Linq was introduced in .NET 3.0 and MonoTouch uses 2.1, I would really like to know what is the timeframe for MonoTouch supporting Linq, such to avoid runtime errors like the one below:

Missing method System.Linq.Expressions.Expression::Call(MethodInfo,Expression,Expression) in assembly /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll, referenced in assembly /Users/l.popescu/Library/Caches/Xamarin/mtbs/builds/*******/76603583-2419-477a-8c05-8d91d6030dcc/assemblies/*****.dll
[...]
System.MissingMethodException: Method not found: 'System.Linq.Expressions.Expression.Call'.
[...]

I don't really fancy the idea of replacing the System.Core.dll, since it violates MS policies, or using tweaks like LinqBridge.

Thank you,
Lucian POPESCU
Comment 1 Sebastien Pouliot 2013-09-28 11:28:02 UTC
Xamarin.iOS already supports LINQ (with the exception of expressions that requires code generation). The old profile (6.2 and earlier) was based on Silverlight, which supported LINQ, while newer versions (6.4+) supports a larger subset of 4.5 (which we call the mobile profile).

Now for some *unknown* reasons I do not see this specific method:

> public static MethodCallExpression Call (MethodInfo method, Expression args0, Expression arg1)

but it should be easy (until fixed) to use the following method instead:

> public static MethodCallExpression Call (MethodInfo method, params Expression [] arguments)


Note: if you find anything else missing simply file a bug report like this one and we'll investigate it.
Comment 2 Sebastien Pouliot 2013-10-02 09:46:51 UTC
Looks like later SL (5?) and 4.0 added a bunch of overloads in Expression and Mono itself miss them (not specific to iOS).
Comment 3 Marek Safar 2013-10-02 11:29:55 UTC
Xamarin.iOS uses .NET 3.5 API for System.Linq.Expression because that the only version where we have at least limited support for interpret due to SRE limitations of iOS. The .NET 4.0 version of the API is not yet supported by Xamarin.iOS.
Comment 4 Marek Safar 2013-10-09 06:58:08 UTC
*** Bug 15089 has been marked as a duplicate of this bug. ***
Comment 5 Sebastien Pouliot 2013-12-10 14:53:38 UTC
*** Bug 16698 has been marked as a duplicate of this bug. ***
Comment 6 Sebastien Pouliot 2013-12-10 14:58:17 UTC
WIthout going to the full 4[.5] API for Xamarin.iOS I think it would be possible to include the new Expression overloads (which simply calls existing methods).

Even more if the new API (like above duplicate) is part of the PCL.
Comment 7 Marek Safar 2014-03-07 09:42:50 UTC
Fixed in master