Actual Error:
Assets file project.assets.json not found. Run a NuGet package restore to generate this file. ‘..\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets’
The error occurs because the dotnet cli does not create the all of the required files initially.
To fix this error from Tools > NuGet Package Manager > Package Manager Console simply run:
dotnet restore
Doing dotnet restore adds the required files.
In case when ‘dotnet restore’ not works, following steps may help:
- Visual Studio >> Tools >> Options >> Nuget Manager >> Package Sources
- Unchecked any third party package sources.
- Rebuild solution.