Bug 4907 - UIImage.FromFile not working with a solution with many projects
Summary: UIImage.FromFile not working with a solution with many projects
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2012-05-06 05:36 UTC by Javier
Modified: 2012-05-15 15:58 UTC (History)
3 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 Javier 2012-05-06 05:36:53 UTC
I have a Windows Phone 7 solution made of 2 projects. The code project , and the assets project. I use Texture2D.FromStream to load the png images. Everything is ok

Then i got monotouch. I created one project, and added on there a folder with the assets. Everything was ok. I could load the images with UIImage.FromFile. Great!!!

But if i want to create another project with all the assets,( and the file properties are the same: Content and Copy if newer), then it seems that they are added as a resource, and i can not use UIImage.FromFile. This is a problem for me, becase i have an editor that builds the project, and only need to attach it to the solution.

I think that it should work as it does in Visual Studio. I think this is a bug, but i'm not sure. Sorry for any inconvenience.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-05-10 18:35:07 UTC
Can you a test project? It would make it a lot easier to figure out what's going on.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2012-05-14 08:23:53 UTC
1) The solution compiles for me.
2) I see the problem with the images from separate projects, currently we do not support this. I'm not entirely sure if we should, in any case it's an issue for MonoDevelop.
Comment 4 Javier 2012-05-14 13:54:46 UTC
1) :S

2) Well, in Windows Phone it works. Maybe it should work for MonoDevelop....

Thanks for your time
Comment 5 Jeffrey Stedfast 2012-05-15 15:58:31 UTC
The problem is that your AssetProject is not a compatible profile (you need to either use a MonoTouch library project or a Portable Class Library project with Profile=Profile2, .NETFramework 4.0 is not compatible)

Your AssetProject is also of type Exe, when it needs to be Library.