Bug 23633 - Relative OutputPath goes out of sandbox build directory on MacOSX host
Summary: Relative OutputPath goes out of sandbox build directory on MacOSX host
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.7
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Adrian Alonso
Depends on:
Reported: 2014-10-06 04:11 UTC by Virgile Bello
Modified: 2014-10-20 13:21 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Project with relative OutputPath (5.50 KB, application/x-zip-compressed)
2014-10-06 04:11 UTC, Virgile Bello

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 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 Virgile Bello 2014-10-06 04:11:09 UTC
Steps to reproduce:
1/ Create iOS project in Visual Studio
2/ Change output path from bin\iPhone\Release to something like ..\..\bin\iPhone\Release
(use case: output multiple projects in a common bin folder)
3/ Build
4/ MacOSX host:
It created a folder in /Users/XXXX/Library/Caches/Xamarin/mtbs/builds/TestOutputRelativePath/../../bin/iPhone/Release

Expected behavior:
it somehow stays inside TestOutputRelativePath sandbox (otherwise output folder might mix with other builds)

I attached a project exhibiting the behavior.
Comment 1 Virgile Bello 2014-10-06 04:11:32 UTC
Created attachment 8314 [details]
Project with relative OutputPath
Comment 2 Virgile Bello 2014-10-06 04:16:59 UTC
Note: Same goes if I have a Content that I added with "Add as Link":
It will be copied in the relative directory on the MacOSX as well.

As an example:
    <Content Include="..\mycontent.txt">

This file will be copied in
/Users/XXXX/Library/Caches/Xamarin/mtbs/builds/TestOutputRelativePath/0f2290a67532a4ae5fa892631XXXXXXX/../mycontent.txt (instead of a subfolder of 0f2290a67532a4ae5fa892631XXXXXXX).
Comment 3 Sadik Ali 2014-10-06 08:37:32 UTC
I have checked this issue and I am able to reproduce it. To reproduce this issue I have followed steps mentioned in the bug description.

Build Log:https://gist.github.com/Parmendrak/9ff7b09c88f38cf4786c
Zipxam Log: https://gist.github.com/Parmendrak/96b1ce2aa622ae6799c0

Environment Info:
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Xamarin (58a59ecb5fa40a0a2e97617c36c069074404c6ae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (04399d62cfc00624d575239d1762ea4fd6d012e2)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (ff9d4a06f588a29e1db224ecd4216f68a9106299)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 4 Adrian Alonso 2014-10-20 13:21:53 UTC
It's not trivial the change that we would need to support this scenario. 

Specifically for the relative output path you could use something like "..\..\$(AppName)\bin" for example in order to keep separate the output for different solutions.

And in general we recommend not to use relative paths for shared assets.