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.
An unhandled exception has occured. Terminating MonoDevelop? True
System.MissingMethodException: No constructor found for MonoMac.Foundation.NSObject+MonoMac_Disposer::.ctor(System.IntPtr)
at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object args, System.Globalization.CultureInfo culture, System.Object activationAttributes) [0x00180] in /Users/marek/git/mono/mcs/class/corlib/System/Activator.cs:299
at System.Activator.CreateInstance (System.Type type, System.Object args, System.Object activationAttributes) [0x00000] in /Users/marek/git/mono/mcs/class/corlib/System/Activator.cs:234
at System.Activator.CreateInstance (System.Type type, System.Object args) [0x00000] in /Users/marek/git/mono/mcs/class/corlib/System/Activator.cs:229
at MonoMac.ObjCRuntime.Runtime.GetNSObject (IntPtr ptr) [0x0007a] in /Users/marek/git/monodevelop/main/external/monomac/src/ObjCRuntime/Runtime.cs:137
at MonoMac.ObjCRuntime.NSObjectMarshaler`1[MonoMac.Foundation.NSObject].MarshalNativeToManaged (IntPtr handle) [0x00001] in /Users/marek/git/monodevelop/main/external/monomac/src/ObjCRuntime/NSObjectMarshaler.cs:33
at (wrapper native-to-managed) object:[MonoMac.Foundation.NSObject:IntPtr NativeRetain()] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector)
at (wrapper managed-to-native) MonoMac.ObjCRuntime.Messaging:void_objc_msgSend_intptr_intptr_bool (intptr,intptr,intptr,intptr,bool)
at MonoMac.Foundation.NSObject.Dispose (Boolean disposing) [0x000af] in /Users/marek/git/monodevelop/main/external/monomac/src/Foundation/NSObject.cs:138
at MonoMac.Foundation.NSObject.Finalize () [0x00001] in /Users/marek/git/monodevelop/main/external/monomac/src/Foundation/NSObject.cs:86
This happens when any MonoMac app shuts down. I can reproduce with MonoMac.dll shipped with MD from Wrench tip, md5 is MD5 (MonoMac.dll) = 70f421da0449f6df4f53ecc5ca328f19.
I just got MD from here: https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=84&host_id=1&revision_id=33792 , created a sample monomac app, but I couldn't reproduce it. Neither does it happen with MonoDevelop itself. Can you reproduce it by just creating a sample monomac app?
*** Bug 4803 has been marked as a duplicate of this bug. ***
I can't reproduce it by creating a sample MonoMac app, but I can reproduce it every time with mdtool, and with my short test program for dispatching Task<T> to Grand Central Dispatch, which can be found at https://raw.github.com/gist/2957032/b0c782ff0e18b2ddfcae210eb38c98cce0d44b9f/GCDTest.cs. I wonder if this has something to do with not calling NSApplication.Main (args), which mdtool cannot call and neither can my GCD tester app.
This happens when when disposing the MonoMac_Disposer on exit.
This should fix it:
Applied Martin's fix.