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 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.
Created attachment 14262 [details] unit test / console line app which exhibits the issue [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method 'Array.Empty' not found. This error seems to be appearing in a few Frameworks https://bitbucket.org/dadhi/dryioc/issues/124/method-arrayempty-not-found-when-running https://github.com/NancyFx/Nancy/issues/2064 The Nancy Guys think the following: "This is what I think you're doing. 1.You are compiling your application on .NET Framework 4.6 where the absence of values to a params string[] parameter gets compiled into Array.Empty<T>() by Roslyn. 2.You then attempt to run this compiled application on an early build of .NET Framework or Mono, where Array.Empty<T> does not exist (source notice that it says Available since 4.6)" Attached is an example bit of code which exhibits the issue. it fails on the line var subscribeAction = Expression.Lambda<Action>(callSubscribe); //Fails on mono
You need to upgrade to Mono 4.2 or newer which support .net 4.6
I see this problem with Stable 4.2.3.4/832de4b. It is easy to replicate: * var array = new Array.Empty<string>(); * Build under VS2015 as a 4.6 app * Run under Mono 4.2.3.4 You get: craig@ubuntu:~/temp$ mono TestArrayEmpty.exe Unhandled Exception: System.MissingMethodException: Method 'Array.Empty' not found. [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method 'Array.Empty' not found. I originally saw this problem with RabbitMQ 3.6.2 from nuget with an app built by VS2015 and run up under Mono 4.2 as above. RabbitMQ does *not* use Array.Empty directly.
Same issue using Mono 4.2.3.4 stable under ARM Linux (Raspbian). Encountered while testing a Nancy application as per this issue: https://github.com/NancyFx/Nancy/issues/2064 The application was built using .net 4.6.2, when reverted to 4.5.2 the issue disappeared.