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
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.
I tried to compile following sample code, but compiler error.
I'm using Mono 2.10.5.
public class TestClass : ITestClass
public TestClass ()
public interface ITestClass
public static class TestClass2
public static void Test()
List<TestClass> list = new List<TestClass>();
public static void TestInterface(IEnumerable<ITestClass> arg)
Error CS1502: The best overloaded method match for `Test.TestClass2.TestInterface(System.Collections.Generic.IEnumerable<Test.ITestClass>)' has some invalid arguments (CS1502) (test)
Error CS1503: Argument `#1' cannot convert `System.Collections.Generic.List<Test.TestClass>' expression to type `System.Collections.Generic.IEnumerable<Test.ITestClass>' (CS1503) (test)
You need to use dmcs compiler (.NET 4.0 profile) which supports interface covariance
I'm using MonoDevelop 2.6RC2 and could compile properly by changing Runtime verion to MONO / .Net4.0 in case C# Library Project.
There is option in Project Options -> Build -> General -> Runtime version.
But When I choose MonoTouch Library Project, I can't change this option and always disabled.
I need to compile by MonoTouch Library.
Could you tell me how I use dmcs compiler in this case?
Unfortunately you can't choose the compiler for MonoTouch.
It will be updated in a future release, but this is still somewhat far ahead (in particular it will not be in the next 5.0 release).