How to Fix "Error NETSDK1005 Assets File project.assets.json Doesn't Have a Target for netstandard2.0"
After updating Visual Studio from 16.7.x to 16.8.2 on our Azure DevOps build server, I got this error message:
##[error]C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5):
Error NETSDK1005:
Assets file ‘c:\agent\_work\***\obj\project.assets.json’
doesn’t have a target for ‘netstandard2.0’. Ensure that
restore has run and that you have included ‘netstandard2.0’
in the TargetFrameworks for your project.
Until the update everything worked, but where in the update did something break? It took me a long time to find a similar problem report to even understand the problem. Thanks to the explanation of Jon Douglas I just needed to change my build definition to use a newer NuGet version (anything above 5.8.0) in the NuGet tool installer task:

This little change was all it took to fix the build job. I hope this helps you as well when Azure DevOps starts to throw such error messages for your projects.