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:
- I can build the solution on my desktop with Visual Studio Community 2019 16.4.6.
- I can build the solution on TFS server remotely with Visual Studio Community 2019 16.5.1 and 16.8.2.
- I cannot build the solution on TFS server via TFS interface. In the build pipeline there is an item
Build Xamarin.Android Project
which usesMSBuild
fromC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
location (I presume VS should use thisMSBuild
file too during manual build). TheMSBuild
file has version 16.8.2.56705. - With the target Android 9 there was no issues with solution building.
What could be a reason? Thank you in advance.