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 for Bug 43931 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
1) Create a normal console application, reference the desktop Xamarin.Mac.dll and make sure libxammac.dylib is local copied.
2) Invoke `NSApplication.Init (); Console.WriteLine (NSApplication.SharedApplication)`
Result: shared application will be null. The reason is that the class pointer is null because AppKit was not loaded when the static constructor for NSApplication ran . We either need to ensure the appkit framework has loaded before we get the class handle for NSApplication, or we need to reload the class handle after we load libxammac.dylib (which ensures App/kit loads as iy is a dependency).
If we want to refresh the handle as part of NSApplications.Init we just have to be careful that our initialisation does not indirectly require that handle to exist.