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.
When calling a static method with a dynamic parameter in a lamda as a argument for the base class constructor the compiler gives this error on Mac OS X:
Error CS1673: Anonymous methods inside structs cannot access instance members of `this'. Consider copying `this' to a local variable outside the anonymous method and using the local instead (CS1673) (POCBugCompiler)
The following code works in Xamarin Studio and Visual Studio on Windows however not on Mac OS X. I am using version 5.10.3 (build 51 of Xamarin Studio) - no updates on stable channel. Mono is version 4.2.3.
public class MyClass
public class SomeBaseClass
public SomeBaseClass(Action action)
public class SomeInheritedClass : SomeBaseClass
public SomeInheritedClass() : base(() =>
public static decimal StaticMethod(dynamic someDynamicArgument)
public static dynamic SomeRandomDynamic()
return new object();
I discovered the bug in a similar call but the static method was located in the base class. If needed i would help with providing more information.
Fixed in master and mono 4.4