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.
Can't always load NSImage by calling NSImage.ImageNamed. Steps:
1) Put Image.png to "Resources/Images" sub-folder.
2) Try loading the image by calling NSImage.ImageNamed("Resources/Images/Image.png") or NSImage.ImageNamed("Image.png").
Result: returned image is null
Expected: image is not null
Workaround: put Image.png to the Resources folder and load it by calling NSImage.ImageNamed("Image.png")
I believe this is the intended behavior. Xamarin.Mac doesn't do anything special here - it just calls the NSImage imageNamed: selector.
You can use methods on NSBundle to get the full path of an image inside the bundle and then load NSImage from a file. From what I understand, imageNamed: does not search subdirectories (this would likely be rather slow).
See for more details:
Got it, thanks.