Bug 32980 - Hint to use the static registrar with JSExport is for iOS, not Mac
Summary: Hint to use the static registrar with JSExport is for iOS, not Mac
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Runtime ()
Version: Master
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Rolf Bjarne Kvinge [MSFT]
Depends on:
Reported: 2015-08-11 17:47 UTC by Aaron Bockover [MSFT]
Modified: 2016-01-06 15:06 UTC (History)
5 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 Aaron Bockover [MSFT] 2015-08-11 17:47:55 UTC
When the dynamic registrar is in use (the default) and JSExport is used to export C#/Objective-C to JavaScriptCore, a warning/info message is printed to stderr since JSExport is only supported via the static registrar:

"ObjCRuntime.RuntimeException: Detected a protocol (Xamarin.Inspector.Mac.Client.ReplWebView+IListener) inheriting from the JSExport protocol while using the dynamic registrar. It is not possible to export protocols to JavaScriptCore dynamically; the static registrar must be used (add '--registrar:static to the additional mtouch arguments in the project's iOS Build options to select the static registrar)."

The message is specific to iOS and should be updated for Mac.

Aside: I didn't even notice this message because it scrolled by too quickly due to all the other logging in my app. As a result I spent about an hour reading headers and searching for examples before figuring it out (thanks to finding bug #23474 via Google and inquiring about it internally). It would be super nice to somehow make this (and other similar situations) more obvious. Maybe a long sleep (gross) or an NSAlert (slightly less gross?).
Comment 1 Danish Akhtar 2015-08-19 04:48:43 UTC
Hi Aaron,

I am trying to reproduce this issue but not sure about the steps. Could you please provide us test case or test sample project? So that I can reproduce this issue at my end.

Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-09-01 03:35:37 UTC
@Danish, no need for you to reproduce this, I know what the problem is.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2016-01-06 15:06:25 UTC

maccore/master: f1fbd62aafe6a2de16bd1721a4ae636cdf6d62f2