Bug 12827 - Absolute path in OutDir or OutputPath silently fails to update output on Mac
Summary: Absolute path in OutDir or OutputPath silently fails to update output on Mac
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.1.x
Hardware: PC Windows
: --- normal
Target Milestone: 1.8.x (VS2013)
Assignee: Marek Habersack
Depends on:
Reported: 2013-06-21 16:18 UTC by Jamie da Silva
Modified: 2013-12-02 05:53 UTC (History)
8 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 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 Jamie da Silva 2013-06-21 16:18:55 UTC
To recreate you can use the Hello World template in Visual Studio. Run the application on the simulator.  Set the OutputPath to an absolute folder - I used a different drive since Visual Studio will convert to a relative path.  (I came across this because of some internal MSBuild scripts that set the output path for me.)  Clear the output and intermediate output folders manually.  Run the application on the simulator again.  It will appear to succeed.  However, if you review the build_package\assemblies folder in the intermediate output it will be empty.  If you clear the mtbs cache on the mac, then you will get the error MT0007:The root assembly '/Users/username/Library/Caches/Xamarin/mtbs/builds/OutDirBugTest/e7a76f27-ec1a-464f-9f25-603d5ad640ca/assemblies/OutDirBugTest.exe' does not exist [E:\Sandbox\OutDirBugTest\OutDirBugTest\OutDirBugTest.csproj].

Without clearing the cache this can show up as the application failing to update on the simulator and debug breakpoints getting out of sync with the simulator (i.e. source not found errors) and other mayhem.

It appears this can be fixed by dropping "$(ProjectDir)" from in front of "$(OutDir)" where it appears in Xamarin.MonoTouch.Common.targets.  I don't know if this would impact the MangleLibraryResources task which uses OutDir and and ProjectDir internally.  In my primitive testing, eliminating every instance of ProjectDir prefixing OutDir fixed the problem.  Although it is the common case, I don't believe it should be assumed that OutDir will be relative.

In my case I was also able to workaround this problem by manually setting the OutputPath in the csproj file to use a relative path that matches the absolute path that would otherwise be used by my internal MSBuild script.
Comment 1 Marek Habersack 2013-10-24 14:57:56 UTC
Fixed in our repositories, the fix will be part of the 1.8 release.
Comment 3 narayanp 2013-12-02 05:53:55 UTC
I have checked this issue with following builds:

All Windows
VS 2013/2012
iOS for VS 1.10.19
X.iOS 7.0.5

When I run project again on Simulator after changing OutputPath and clearing intermediate output folders manually, I am not getting build_package\assemblies folder in the intermediate output as empty. also after clearing mac server log, it gets cleared, no error appears.

Changing the status to Verified.