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:

  1. Visual Studio >> Tools >> Options >> Nuget Manager >> Package Sources
  2. Unchecked any third party package sources.
  3. Rebuild solution.

Leave a Reply

Your email address will not be published. Required fields are marked *