Bug 2254 - Issues adding files when opening project from symlinked path
Summary: Issues adding files when opening project from symlinked path
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: PC Mac OS
: --- minor
Target Milestone: ---
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2011-11-29 14:12 UTC by Mikayla Hutchinson [MSFT]
Modified: 2011-12-05 10:48 UTC (History)
2 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 Mikayla Hutchinson [MSFT] 2011-11-29 14:12:20 UTC
If a solution is opened from a directory that's actually a symlink to another directory, MD doesn't resolve the symlink, so all paths in MD will use the unresolved value.

However, the MacOS native "Open" dialog does resolve symlinks, so when you try to add existing files from the project directory, MD thinks they're outside the project directory and tries to copy/link/move them.

Since the "Open Solution" dialog is also native, then opened solutions should use resolved paths too. However, it it possible to reproduce this problem using "recently used" solution with the old path that had originally been opened by an older version of MD that did not have Mac native dialogs.
Comment 1 Mikayla Hutchinson [MSFT] 2011-11-29 14:21:41 UTC
Note that Finder and "open" also appear to resolve symlinks.
Comment 2 Mikayla Hutchinson [MSFT] 2011-11-29 17:51:47 UTC
OK, there's still a way to repro this. A newly created project can be created at an unresolved path, and the unresolved path will be persisted in the Recent Files list.
Comment 3 Alan McGovern 2011-12-05 08:47:16 UTC
I added the ability to resolve symlinks to FileService so we can just call FileService.ResolveFullPath. On windows this is currently just a call to Path.GetFullPath. On unix systems it p/invokes libc to invoke 'realpath' which resolves symlinks. If this is not ok, a solution could be created using Mono.Posix and manually walking the path to check for symlinks.