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.
Created attachment 22510 [details]
Reported from here: https://forums.xamarin.com/discussion/comment/276776#Comment_276776
- Expand sample and build/run
- Click button and note that 2nd text field gives type of: WebKit.DomNode
- Add --registrar:dynamic and repeat. Type is WebKit.DomHtmlDivElement (this is the expected behavior)
- Add static instead. Type is WebKit.DomHtmlDivElement (as expected).
This is fixed in master, but I can reproduce the failure in 15.2.
This happens because in 15.2, we don't link all the system frameworks into the executable at build time, they're loaded at a later point.
However the partial static registrar loads the Objective-C class at startup (before main), which means that it won't find the DOMHTMLDivElement class, and thinks it doesn't exist, so at a later point XM will instantiate the first known supertype (in this case DomNode).
In master we're linking with all the required frameworks, which means we'll find the DOMHTMLDivElement class at startup, and the problem doesn't occur.
Great analysis Rolf (as always).
As a work around, adding these mmp link flags:
appears to be an acceptable work around.