Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
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)));
Probably there is some kind of workaround in consumer-side code to help AOT ?
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.
might also work.
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.