[XBuild] Bug 25480 - OutputPath property is not set for this project
commit77972f864dec20ac5f40b44bfa686442f7db8976
authorDavid Karlaš <david.karlas@xamarin.com>
Mon, 21 Sep 2015 18:28:43 +0000 (21 20:28 +0200)
committerDavid Karlaš <david.karlas@xamarin.com>
Thu, 24 Sep 2015 15:18:14 +0000 (24 17:18 +0200)
tree2abb54d4335e1ec8c37ef0d23eaeb9a5593ce6ae
parent4a18c575ac105b920ec7fb37b24ffe74ad9b3bd7
[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