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
GitHub or Developer Community 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.
The code below (even if a valid (Not Null) AggregateCatalog is provided) gives the error.
System.MissingMethodException: Method 'Array.Empty' not found.
using (CompositionContainer container = new CompositionContainer((AggregateCatalog)null))
An update that might help you debug.
This code will throw the "System.MissingMethodException: Method 'Array.Empty' not found." error.
/// Gets the container.
/// <value>The container.</value>
private CompositionContainer ContainerOrig
if(null == _Container)
_Container = new CompositionContainer(Catalog);
However after using IlSpy to see what is going on in System.ComponentModel.Composition.Hosting I created this Change (so I don't pass an empty array. Hope this helps
private CompositionContainer Container
if (null == _Container)
ComposablePartExportProvider partExport = new ComposablePartExportProvider(CompositionOptions.Default);
CatalogExportProvider catalogExport = new CatalogExportProvider(Catalog, CompositionOptions.Default);
ExportProvider providers = new ExportProvider;
providers = new AggregateExportProvider(new ExportProvider
_Container = new CompositionContainer(Catalog, CompositionOptions.Default, providers);
partExport.SourceProvider = _Container;
catalogExport.SourceProvider = _Container;
I think I spoke to soon.
I will keep looking into a work around
I have verified that that does resolve the issue for this problem, perhaps it can lead you to a better resolution
I think Array.Empty was later added to 4.4. Howard, can you try with that version?
Alexander, can you help us with this one?
That is correct, Array.Empty<T> was added in Mono 4.4.
I tried the code you posted in #c0 and it doesn't throw the exception for me. I'm closing this, please reopen if you run into issues with Mono 4.4. Thanks!