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 2150 [details]
Patch to fix problem
Quite often, while browsing an assembly, it'll fail with "Failed to resolve type". One easy way to reproduce the problem is to open up Mono's System.Windows.Forms, and try to browse the top level of the Application class -- it'll fail to resolve the System.ComponentModel.EditorBrowsableState enum.
In any case, after digging through the code for a while, the fix was easy -- it's a bug in SimpleAssemblyResolver.InternalResolve(). After it reads as assembly, it doesn't double-check that the assembly's FullName matches the one it's looking for.
In the above example, it was looking for "System, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089" and instead found "System.ComponentModel.DataAnnotations, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35", and put that in the cache. Needless to say, hilarity ensues.
The enclosed patch fixes the problem.
There's another call to ReadAssembly() a few lines later, but I don't understand the code well enough to speculate on whether this fix is applicable there.
Thanks for the fix.