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:
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.What could be a reason? Thank you in advance.
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.