Bug 58808 - Composition broken in latest Visual Studio 2017 (15.3)
Summary: Composition broken in latest Visual Studio 2017 (15.3)
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.4 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2017-08-16 11:57 UTC by Silviu Lupu
Modified: 2017-08-17 07:17 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 Silviu Lupu 2017-08-16 11:57:21 UTC

After I updated to 15.3 Visual Studio 2017, my Xamarin.Android project stopped working. The issues I am having are composition related (System.ComponentModel.Composition). Everything was ok when I was running in Debug Mode in 15.2. But now, either the dlls are not deployed in a visible directory (emulator/0/Android/data/...), either they are there, but I get never before seen errors when I try to GetExport.

On of them is:
14:46:49:5797 ERR System.InvalidOperationException: GetExportedValue cannot be called before prerequisite import 'xxx.Managers.TraceManager..ctor (Parameter="logger", ContractName="xxx.Interfaces.ILogger")' has been set.
  at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.EnsureGettable () [0x0006a] in <41a6006520d646a7b48b5415bbcf1c5a>:0 
  at System.Lazy`1[T].CreateValue () [0x00081] in <183b200ee49746d48fc781625979428e>:0 
  at System.Lazy`1[T].LazyInitValue () [0x00023] in <183b200ee49746d48fc781625979428e>:0 
  at System.Lazy`1[T].get_Value () [0x0003a] in <183b200ee49746d48fc781625979428e>:0 

Do I need to change something to make Composition work like it did in 15.2?

Thank you
Comment 1 Jon Douglas [MSFT] 2017-08-16 17:44:46 UTC
In order for us to further investigate and provide a workaround, can you please attach a minimal reproduction project that demonstrates the issue? Please also include your current Visual Studio information via Help->About Visual Studio.

Thank you!
Comment 2 Silviu Lupu 2017-08-17 07:17:39 UTC

Unfortunately, I am unable to reproduce the issue at a small scale. I will try to see if anything else in my code is generating this issue. If I find anything, I will reopen this discussion, with a sample. 

Thank you.