Bug 61106 - Xamarin Live Player on Android, v 1.3.117. Doesn't appear to work with AutoFac v 4.6.2.
Summary: Xamarin Live Player on Android, v 1.3.117. Doesn't appear to work with AutoFa...
Status: CONFIRMED
Alias: None
Product: Live Player
Classification: Xamarin
Component: Mobile App Android ()
Version: 1.0.507
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-12-15 10:13 UTC by John Hair
Modified: 2018-02-04 20:46 UTC (History)
2 users (show)

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


Attachments
Sample Project (270.84 KB, application/x-zip-compressed)
2017-12-16 19:15 UTC, James Montemagno [MSFT]
Details
Added another sample (212.01 KB, application/zip)
2018-01-18 19:46 UTC, James Montemagno [MSFT]
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 for Bug 61106 on Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.
Related Links:
Status:
CONFIRMED

Description John Hair 2017-12-15 10:13:22 UTC
Using VS2017 15.4.5
.netstandard 2.0 XF solution

When running Live Player on Samsung SM-G950F without live player, app starts but throws an exception when running Build() on the AutoFac ContainerBuilder() instance. Code for preparing the container:

        private void PrepareContainer(IModule[] platformSpecificModules)
        {
            var builder = new Autofac.ContainerBuilder();
            //RegisterPlatformSpecificModules(platformSpecificModules, builder);
            //Register(builder);
            _container = builder.Build(); --< Crashes here
        }

The exception is:
Visualization Error
No body on method System.Collections.Generic.IEnumerable'1<AutoFac.Core.IComponentRegistration>

Fails even when not registering anything for DI. works fine when app run on device as normal, however.
Comment 1 James Montemagno [MSFT] 2017-12-16 19:15:30 UTC
Created attachment 26023 [details]
Sample Project
Comment 2 James Montemagno [MSFT] 2017-12-16 19:17:20 UTC
Reproduced and added sample.

If you add a different page and do Live Run for that page that doesn't have AutoFac that seems to work. So adding the nuget is okay, but the registration doesn't work.
Comment 3 James Montemagno [MSFT] 2018-01-18 19:46:35 UTC
Created attachment 26095 [details]
Added another sample
Comment 4 vonneucode 2018-02-04 20:46:47 UTC
The sample worked in the latest live player after updating the Build with the parameter as below

containerBuilder.Build(Autofac.Builder.ContainerBuildOptions.None);