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.
The templates and designer files that MD generates have [Register("foo")] attributes applied. Since they're not fully qualified, they can be silently hidden by a user class in the same namespace and the resulting errors are hard to track down. The same likely applies to Outlet and Export attributes.
It would seem a shame to fully qualify them all since that would make all the templates and generated code ugly. Maybe it would be possible for the Xcode integration to inspect all attributes on the NSObject-derived classes and warn if a RegisterAttribute has been hidden by another class.
Alternatively this might be something that a Gendarme analysis could look for.
Our dev team has encountered this problem within our own codebase. We had to classes named "Foo" in two different namespaces. We encountered an InvalidCastException at runtime in the managed/unmanaged transition code because the wrong type was selected.
*** Bug 7199 has been marked as a duplicate of this bug. ***
If there is any additional information you'd like to contribute, please comment on this report. This enhancement request has been noted and will now be closed.
Thank you everyone for the feedback.