Assets file project.assets.json not found. Run a NuGet package restore to generate this file

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.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s