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.
It seems that sometimes changes in XIB files performed in XCode are not recognized by MD's iOS plugin. It is hard to reproduce, but I believe it's FileSystemWatcher related, because it seems only to happen under a slight system load.
I wonder if it won't be better to symlink the XIBs instead of copying them into XCode's mirror project, if possible.
There's no FileSystemWatcher involved, since it's unreliable on Mac. Instead, when MD regains focus we use AppleScript to make Xcode save all open documents in the project, then check all the xibs' write times against a cache of times that the files were copied out. The copies use hard links, however it appears that Xcode uses the old trick of writing a new file a copy and renames it over the old one to ensure an atomic write, so I don't think symlinks would work.
Maybe when the IO subsystem is under load there's a race between the AppleScript save call returning and the file actually being flushed to disk.
Michael, thanks for explaining the internals.
I think I know how I broke the synchronization: I've closed XCode out of bad habit (I used to close IB3 like this) prior to switching back to MD.
I saw that in this case MD is re-spawing XCode right after it has regained the focus (maybe due to the aforementioned AppleScript). The new XCode instance is "empty" (no project loaded).
It sounds like something got broken in MD - we test Xcode's open before trying to run the AppleScript, so it shouldn't be re-spawning. I suppose it's also possible that the syncback early-exits if Xcode isn't open and misses the updated file - we'll have to check those codepaths.
Another reason why we can't use symlinks is that not all filesystems support it, such as network filesystems. We couldn't use symlinks as the only supported mechanism as it would just fail for people opening their projects over the network.
Also, closing xcode and then going back to MD is exactly what I do every time. My guess would be that MonoDevelop is regaining focus before the xcode app has completely finished shutting down. That way we send applescript which is then picked up by a new app instead of the one we intended.
I'll review the code and see if I can figure out what's gone wrong with the sync'ing. There are a couple of things we can try to improve things.
Can you confirm that you were experiencing this issue with MonoDevelop 2.8.1 or higher with Xcode 4.2? I'm just looking into the code and can't see what would cause this problem. We seem to have all our applescript covered with checks to ensure that we do not accidentally re-launch Xcode if it has been shut down.
Would you able to give a more detailed description of the steps you follow to reproduce the issue? Is it simply a case of:
1) Open a xib in xcode
2) Make some modifications
3) Hit save
4) Press command-q to close xcode
5) MonoDevelop does not sync the changes and instead relaunches and empty xcode
It was 2.8.x (x < 2) from the stable channel as of 2011-10-23 11:13.
Yes, the steps were pretty much these, plus the system load. I'll retest with 2.8.2 and come back to you.
Do you have any further information on this or has the issue been fixed?
This cannot be reproduced anymore and I've spent some time trying. If it manifests again, do let me know!
I cannot reproduce it with 2.8.5 anymore. Thanks!
I have validated this issue and followed the steps provided by Alan and did not get this issue.
Please close this issue or let me know if I am in wrong direction.
Mono Develop 2.8.5 Stable.
Mono Touch 5.0.4 Stable
Mono Framework 2.0.7
Xcode 4.2 iOS 5