Bug 59567 - Design-time build fails if project references (indirectly) Xamarin.Build.Download
Summary: Design-time build fails if project references (indirectly) Xamarin.Build.Down...
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 8.1 (15.5)
Hardware: PC Mac OS
: High major
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2017-09-18 18:11 UTC by Jérémie Laval
Modified: 2017-12-01 11:43 UTC (History)
3 users (show)

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

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 for Bug 59567 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Jérémie Laval 2017-09-18 18:11:37 UTC
With an Android project referencing support libraries (before or Google Play Services, the UpdateAndroidResources target will fail in an IDE context because less things are now being run (in that case, no ResolveAssemblyReferences) triggering an error with the Xamarin.Build.Download targets that are implicitely referenced by those packages.

Repro: run `msbuild /t:UpdateAndroidResources /p:DesignTimeBuild=true /p:BuildingInsideVisualStudio=true /v:diag AndroidApp.csproj`

Outcome: Xamarin.Build.Download.targets(114,3): error : Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Basement'

Diagnostic log: https://gist.github.com/garuma/294bb5c0f118ff935c40f5e636ec7a2d
Comment 1 Jérémie Laval 2017-09-18 18:12:57 UTC
This has also the effect that the Android designer will constantly show a warning to users that their resources are likely wrong but where a normal build doesn't exhibit the problem.
Comment 2 Jon Dick 2017-09-18 18:38:20 UTC
We have a pull request open which makes Xamarin.Build.Download explicitly depend on `ResolveAssemblyReferences` target so that no matter how our task is invoked, it should ensure the references are resolved first.

Comment 3 Jérémie Laval 2017-09-19 16:57:18 UTC
To update comment #1, Dean referred me to a property the designer can set to revert the target to the older behavior which also means this issue won't show up for the designer.
Comment 5 dean.ellis 2017-12-01 11:43:48 UTC
Can we mark this as fixed?