Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
GitHub or 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.
This appears to be related to some of the recent comments in Bug #25480. I'm unable to build an iOS csproj file that belongs to a cross platform solution with xbuild.
The error informs me that I don't have an OutputPath set, which is incorrect. The project has a PropertyGroup which matches the configuration and platform I am providing, and also defines an OutputPath. Additionally, OutputPath is defined in both xbuild and msbuild diagnostic build output, however it still can't be reconciled and the build fails.
### Steps to reproduce ###
1. Download / clone https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithColors
2. nuget restore WorkingWithColors/WorkingWithColors.sln
3. xbuild /p:Configuration=Debug /p:Platform=iPhone WorkingWithColors/iOS/WorkingWithColors.iOS.csproj
### Xbuild Output ###
### MSBuild Output ###
### Environment ###
Mono JIT compiler version 4.6.0 (mono-4.6.0-branch/746756c Thu Sep 8 05:39:12 EDT 2016)
Discussed this with Ankit, marking as resolved answered.
"The scenario is that `WorkingWithColors.iOS.csproj`(1) is being built and that references `WorkingWithColors.csproj`(2), so xbuild/msbuild tries to “resolve” that referenced project by trying to run a target for (2). Now, (1) has `OutputPath` set for `Debug|iPhone`, but (2) does not have `Debug|iPhone`, it has `Debug|AnyCPU` instead. And that is valid, because that (1)’s `config|platform` maps to (2)’s `config|platform`, but this *mapping* information is available in the `.sln` file! Which means that if you directly try to build the `csproj` then that mapping info is not available and (2) is built with `Debug|iPhone` and hence it has no `OutputPath` set!
IOW, there is configuration mapping involved here between projects, and that info is present in sln file, so you can’t build the csproj directly"