Bug 36077 - Incorrect use of .NET 4.6 target leads to generation of Array.Empty()
Summary: Incorrect use of .NET 4.6 target leads to generation of Array.Empty()
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-11-19 21:25 UTC by Jerome Laban
Modified: 2017-06-28 12:22 UTC (History)
9 users (show)

Tags: BZCU
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:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Jerome Laban 2015-11-19 21:25:55 UTC
When building a two-assemblies solution, if :

  - The "head" uses a specific version of the Android SDK (e.g. 19)
  - A dependent assembly in the same solution is build using "use latest version of the SDK"
  - The latest installed version of the android SDK on the system is *not* 19

Then the build will choose .NET 4.6 as the target runtime passed to the C# 6.0 compiler, which in turn will transform "new int[0]" into "Array.Empty<int>()" which is currently not supported in Mono.

This leads to either linker errors such as https://bugzilla.xamarin.com/show_bug.cgi?id=29882.
Comment 1 Adam Hartley [MSFT] 2017-06-28 12:07:01 UTC
Unfortunately, we’re unable to reproduce this report. If this issue is still occurring for you, please reopen this issue and attach a reproduction to the bug by starting with a clean Xamarin.Android project adding just the code necessary to demonstrate the issue.
Comment 2 Adam Hartley [MSFT] 2017-06-28 12:07:27 UTC
Unfortunately, we’re unable to reproduce this report. If this issue is still occurring for you, please reopen this issue and attach a reproduction to the bug by starting with a clean Xamarin.Android project adding just the code necessary to demonstrate the issue.
Comment 3 Jerome Laban 2017-06-28 12:22:46 UTC
This happened during the transition between versions of the .NET 4.6 BCL and Xamarin that did not support this method.

This does not happen anymore.