Bug 847 - Images not getting updated on Simulator when changed in MonoDevelop
Summary: Images not getting updated on Simulator when changed in MonoDevelop
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 4.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-15 17:59 UTC by Ian
Modified: 2011-10-06 17:28 UTC (History)
5 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Ian 2011-09-15 17:59:19 UTC
Using MonoDevelop 2.6.1 and MonoTouch 4.x

When an image is changed in the project which is set as "content", the image is not refreshed when the app is rebuilt. This happens even if the MonoDevelop "Clean" command is used.

The only way to get an image updated is to delete the bin and obj folders and then delete the app on the simulator.

Rebuilding then allows for the new image to be used.
Comment 1 Mikayla Hutchinson [MSFT] 2011-09-15 18:23:08 UTC
Reassigning to MonoTouch, since its mtouch tool deploys the app to the simulator.
Comment 2 Sebastien Pouliot 2011-09-16 07:31:18 UTC
The 'mtouch' tool does not deploy, it simply ask the simulator to use the .app directory that MD created. Then the simulator proceed to deploy (copy some of) the files into it's own directory. 

We had issues (and workarounds) for stale assemblies in the past. What happens is that the simulator updates files but never deletes them (if they were not longer part of the original .app). However I'm not aware that it ever failed to update files. The only workaround was to reset the simulator (not even deleting the .app in the simulator was enough).

Anyway there's a bug somewhere in the chain of events. Can you provide us with a small, self-contained, test case that shows the issue ? Thanks!
Comment 3 Ian 2011-09-16 11:29:05 UTC
How to repo

1> File/New/Project
2> Add an image as content
3>build to simulator
4>replace image with new one of same name
5>build to simulator

Old image remains
Comment 4 Ian 2011-10-03 18:29:51 UTC
Example of how to repro bug in 2011-09-16 comment.
Comment 5 Jeffrey Stedfast 2011-10-06 15:59:55 UTC
I can confirm this is an issue with MonoDevelop 2.8.0 and MonoTouch 4.2.2

Looks like MonoDevelop is not copying the files to bin/Debug/iPhoneSimulator/MyApp.app/<relativepath>

However, checking the properties on the file in MonoDevelop, I see that the defaults are:

Build Action: Content
Copy to output directory: Do Not Copy

Changing "Do Not Copy" to "Copy if newer" fixes the problem for me.
Comment 6 Jeffrey Stedfast 2011-10-06 16:00:14 UTC
Ian: can you confirm?
Comment 7 Mikayla Hutchinson [MSFT] 2011-10-06 16:01:30 UTC
That can't be correct. Copy to output has zero effect on the app bundle.
Comment 8 Jeffrey Stedfast 2011-10-06 16:11:05 UTC
It makes a difference for me.

(Note that for Default.png, it doesn't appear to matter, but if you add a file named Xamarin.png, for example, setting that to Copy if newer makes all the difference in the world)
Comment 9 Jeffrey Stedfast 2011-10-06 16:23:17 UTC
hmmm, I probably shouldn't have marked this FIXED yet. If this does solve it for Ian, then we probably want to look into why the default settings don't work and either make the default "Copy if newer" or fix whatever underlying issue remains.
Comment 10 Ian 2011-10-06 16:37:13 UTC
Fixed
Comment 11 Mikayla Hutchinson [MSFT] 2011-10-06 16:37:26 UTC
The Content build action is what causes the file to get copied into the app bundle.

Copy to Output only causes it to get copied to the output directory, which has no effect on the app bundle at all.
Comment 12 Jeffrey Stedfast 2011-10-06 17:28:04 UTC
Looks like Michael has tracked down the real issue (turns out that the "Copy if newer" change just happened to cause a side-effect which made this work)

Fixed in git, will be in 2.8.1