0
votes

I have updated my Android app target from Android 9 to Android 10 (in accordance with Google Play requirements) recently, and now solution doesn't build on TFS with error:

C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1005: Assets file '...\obj\project.assets.json' doesn't have a target for 'netstandard2.1'. Ensure that restore has run and that you have included 'netstandard2.1' in the TargetFrameworks for your project.

There is the library in the solution that really targets to netstandard2.1, but:

  1. I can build the solution on my desktop with Visual Studio Community 2019 16.4.6.
  2. I can build the solution on TFS server remotely with Visual Studio Community 2019 16.5.1 and 16.8.2.
  3. I cannot build the solution on TFS server via TFS interface. In the build pipeline there is an item Build Xamarin.Android Project which uses MSBuild from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin location (I presume VS should use this MSBuild file too during manual build). The MSBuild file has version 16.8.2.56705.
  4. With the target Android 9 there was no issues with solution building.

What could be a reason? Thank you in advance.

1

1 Answers

0
votes

I followed this recommendation to update nuget.exe to the latest version and it helps. But I'm still wondering why simple target's updating without VS update broke a build.