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
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.
It is not possible to build different iOS or Mac projects within a single solution that require different versions of Xcode. This is a regression introduced by fixing https://bugzilla.xamarin.com/show_bug.cgi?id=46257
Within a single msbuild process (e.g. msbuild Foo.sln):
1. Solution builds Foo.MacApp.csproj against already-configured environment (say, /Applications/Xcode_8.3.3.app), all is well
2. Now we need to build Foo.iOS.csproj, but against a different Xcoee (say, /Applications/Xcode_9.app). The target sets the environment variable [MD_APPLE_SDK_ROOT=/Applications/Xcode_9.app] to happen before the regular build starts
3. When the normal iOS build process starts, DetectSdkLocationsTaskBase.Execute will be called, which immediately calls Xamarin.MacDev.AppleSdkSettings.CheckChanged, which _should_ notice that the paths differ since the last run (from (1)), and reload everything (by calling Xamarin.MacDev.AppleSdkSettings.Init). However, this code has been completely commented out with no indication as to why.
As a result, whatever Xcode is used _first_within_the_process_ will be cached forever.
I have implemented a ReloadXcodeSettings task that we are now using to work around this for now: