Bug 14765 - MT2002:Failed to resolve "System.Linq.Expressions.DefaultExpression System.Linq.Expressions.Expression::Default(System.Type)" reference
Summary: MT2002:Failed to resolve "System.Linq.Expressions.DefaultExpression System.Li...
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.4.4
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-09-15 12:31 UTC by Grigory (Playtika)
Modified: 2013-09-16 15:07 UTC (History)
2 users (show)

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

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:

Description Grigory (Playtika) 2013-09-15 12:31:35 UTC
I see lack of some simple expressions in System.Linq.Expressions that prevent me from using Autofac.
Those are 
1. Expression.Assign
2. Expression.Variable
3. Expression.Block
4. Expression.Default

Monotouch doesn't support dynamic code generation thru Reflection.Emit but i don't see a word about Expression.Compile. Correct me please if i'm wrong.

At the same time MonoDroid supports those.

Do these expressions involve some codegen that is not supported by AOT compiler ?
Comment 1 Sebastien Pouliot 2013-09-16 15:07:34 UTC
Full Expression support requires System.Reflection.Emit. You can see it inside the Mono BCL source code [1].

Full support requires JIT'ing and is not supported on iOS (since Apple disallow generating / JIT'ing code). As such Xamarin.iOS supports a subset of Expression using an expression interpreter.

If your application against an assembly that refers to missing types you'll get MT2002 errors. That's normal as the references are missing from System.Core.dll shipped with Xamarin.iOS.

[1] https://github.com/mono/mono/tree/master/mcs/class/System.Core/System.Linq.Expressions