Bug 14942 - Monotouch debugger errors with "Incorrect number or types of arguments" on showing .ToString of value type containing nested value types
Summary: Monotouch debugger errors with "Incorrect number or types of arguments" on sh...
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.8.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2013-09-23 18:01 UTC by Kirk Woll
Modified: 2013-09-27 10:50 UTC (History)
6 users (show)

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:

Description Kirk Woll 2013-09-23 18:01:29 UTC
Consider the following error:

> Incorrect number or types of arguments

In Xamarin Studio's debugger, the following Monotouch code will cause this error when inspecting the value of instances of `Bar` (by mouse-overing, watches, locals, etc.)

namespace ToStringAndValueType
    [Register ("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
            var bar = new Bar();
            return true;  // <-- Put breakpoint here and mouseover "bar" when the breakpoint is hit
    public struct Bar
        private Foo foo1;
        private Foo foo2;  // <-- Comment out this line and the bug goes away

        public override string ToString()
            return "it does not matter what goes here";
    public struct Foo

This makes debugging my custom value type very difficult, as it does not display the .ToString info when using the debugger.
Comment 1 Jeffrey Stedfast 2013-09-26 18:11:22 UTC
Zoltan, Marek, any ideas?

This has to be either a runtime or compiler bug afaict.
Comment 2 Zoltan Varga 2013-09-26 18:26:03 UTC
Which sdb method throws this exception ?
Comment 3 Jeffrey Stedfast 2013-09-26 19:23:09 UTC
The ObjectMirror method for invoking methods on the object.
Comment 4 Zoltan Varga 2013-09-27 06:35:52 UTC
Fixed in mono master 9c2e07499ec0cbd6ee94516a9aec539b0162862f.
Comment 5 Jeffrey Stedfast 2013-09-27 08:02:28 UTC
Reassigning to the iOS and Android teams so they know to pull in this mono commit
Comment 6 Rolf Bjarne Kvinge [MSFT] 2013-09-27 09:08:15 UTC
iOS bumped.

monotouch/master: a77096b5eae9ddb22ef7ed25742f9ae90d0be99c
Comment 7 Jonathan Pryor 2013-09-27 10:50:31 UTC
Xamarin.Android bumped.

monodroid/master: 5f5407d78f88f029f440d3896e7d4d7820484aa4