[XBuild] Bug 25480 - OutputPath property is not set for this project
authorDavid Karlaš <david.karlas@xamarin.com>
Mon, 21 Sep 2015 18:28:43 +0000 (20:28 +0200)
committerDavid Karlaš <david.karlas@xamarin.com>
Mon, 21 Sep 2015 18:28:43 +0000 (20:28 +0200)
commit76c6a08e730393927b6851709cdae1d397cbcc3a
treefc1b11e07aa1965cd8623b7beb8fc75efce14826
parent8719a2a6d25c97946ff47f195fcd50854e14bb29
[XBuild] Bug 25480 - OutputPath property is not set for this project
This error was generated when iOS(or any other kind of project, that is referencing other project in solution via <ProjectReference>) wanted to get OutputPath of PCL(or any other referenced project) but it failed in case of IDE because wrong conditions(see .targets files changes). Reason this bug was never discovered before is because PCL project was already loaded before with correct configuration/platform so not having AssignProjectConfiguration target executed had no effect. Reason it appeared in this case(Bug 25480) was that .sln and .csproj<ProjectReference> had folder path defined as XamlSamples but actual file system had xamlsamples(notice different chars casing). So projects.TryGet(filePath, out project) failed, hence project had to be reloaded, and then bug from .targets files showed up...

A bit more details about fix: The AssignProjectConfiguration target assigns configurations to the various @(ProjectReference), and is used from targets like ResolveProjectReferences, which are enabled only while building solution files ( $(BuildingSolutionFile) ) or when invoked from the IDE ( $(BuildingInsideVisualStudio) ). But the AssignProjectConfiguration target ignores the IDE case, which breaks usage of ResolveProjectReferences from the same. Fix up to run for both the cases.
mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
mcs/tools/xbuild/data/14.0/Microsoft.Common.targets
mcs/tools/xbuild/data/2.0/Microsoft.Common.targets
mcs/tools/xbuild/data/3.5/Microsoft.Common.targets
mcs/tools/xbuild/data/4.0/Microsoft.Common.targets