Bug 9104 - IntermediateOutputDirectory is computed incorrectly when "Platform" is set, causing the project to flagged out of date at all times
Summary: IntermediateOutputDirectory is computed incorrectly when "Platform" is set, c...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-12-21 12:01 UTC by David McFarland
Modified: 2012-12-28 18:15 UTC (History)
1 user (show)

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

patch to unify obj/ with bin/ logic (5.01 KB, patch)
2012-12-21 12:01 UTC, David McFarland

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:

Description David McFarland 2012-12-21 12:01:56 UTC
Created attachment 3118 [details]
patch to unify obj/ with bin/ logic

Currently the ProjectConfiguration.IntermediateOutputPath is always set to:


In order to match xbuild/msbuild, it needs to be as above when $(Platform) == 'AnyCPU', but otherwise:


The xbuild script says:

mcs/tools/xbuild/xbuild/4.5/Microsoft.Common.targets:           <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
mcs/tools/xbuild/xbuild/4.5/Microsoft.Common.targets:           <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>

The result of this is when you have a project set to a platform other than 'AnyCPU', and you have a .resx file in it (it may not be limited to resx), it will look for the built .resource file in the wrong place, and the build will be considered out of date.

I've attached a patch that will set the default obj/ path in the same way bin/ is currently handled.  It should also allow IntermediateOutputPath to be set explicitly in the build script (without being visible in the UI), but I haven't tested that yet.

P.S.  I put this in 'general' because the patch extends slightly outside of DotNetProject.
Comment 1 Mikayla Hutchinson [MSFT] 2012-12-28 18:15:45 UTC
Thanks for the patch, however it will unnecessarily cause the IntermediateOutputPath value to be stored explicitly in the csproj file for every configuration. I have committed a different implementation that handles custom values, but instead of storing the default value, computes it as needed.