Bug 14766 - System.ExecutionEngineException: Attempting to JIT compile method 'Autofac.Builder.RegistrationBuilder`3<int, Autofac.Builder.ConcreteReflectionActivatorData, Autofac.Builder.SingleRegistrationStyle>:As<System.IFormattable> ()'
Summary: System.ExecutionEngineException: Attempting to JIT compile method 'Autofac.Bu...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.4.4
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-09-15 13:10 UTC by Grigory (Playtika)
Modified: 2013-09-23 10:33 UTC (History)
3 users (show)

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


Attachments
Slightly cut version of Autofac and simple repro (605.43 KB, application/octet-stream)
2013-09-15 13:10 UTC, Grigory (Playtika)
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 NOT_REPRODUCIBLE

Description Grigory (Playtika) 2013-09-15 13:10:32 UTC
Created attachment 4889 [details]
Slightly cut version of Autofac and simple repro

System.ExecutionEngineException: Attempting to JIT compile method 'Autofac.Builder.RegistrationBuilder`3<int, Autofac.Builder.ConcreteReflectionActivatorData, Autofac.Builder.SingleRegistrationStyle>:As<System.IFormattable> ()' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.


Autofac Method code
public IRegistrationBuilder<TLimit, TActivatorData, TRegistrationStyle> As<TService>()
{
    return As(new TypedService(typeof(TService)));
}
Comment 1 Grigory (Playtika) 2013-09-15 13:48:00 UTC
Probably there is some kind of workaround in consumer-side code to help AOT ?
Comment 2 Zoltan Varga 2013-09-15 16:58:45 UTC
Could you try the 6.9.7 version from the alpha channel ?

As for a workaround, you can try calling the exact method directly to tell the AOT compiler that it will be used. Telling the AOT compiler about just the class, i.e.
typeof (Autofac.Builder.RegistrationBuilder<int,
Autofac.Builder.ConcreteReflectionActivatorData,
Autofac.Builder.SingleRegistrationStyle>)
might also work.
Comment 3 Sebastien Pouliot 2013-09-23 10:33:50 UTC
The attached sample works fine for me using 7.0.0. Please re-open, with a new test case, if you have any further issue.