February 20, 2020

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

In Visual Studio 2017, while working with .Net Core Web Applications, I encountered this error:

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

While searching for this, I found a number of options you can try to fix this issue.

  1. Simplest of the solution could be just to close and re-open the Visual Studio, in some cases this might help.

  2. Another thing could be simply delete the bin and obj folders, clean and rebuild the solution.

  3. Go to Tools > NuGet Package Manager > Package Manager Console, and run this command:

    dotnet restore
    

    Or for specific project:

    dotnet restore [project or solution name]
    

    Executing dotnet restore adds all the required files.

  4. If simply restoring NuGet packages does not work make sure in Tools > Options > NuGet Package Manager > General under Package Restore that the Allow NuGet to download missing packages is checked.

    Then try restore packages, and rebuild after deleting obj and bin folders

  5. Try clearing the Nuget cache.

    Go to Tools > Options > NuGet Package Maneger > General > click on Clear All Nuget Cache(s)

  6. Run command dotnet build.

    dotnet build
    

    It runs the restore by default.

1 comment:

  1. Strange "water hack" burns 2lbs overnight

    At least 160000 men and women are trying a easy and secret "liquids hack" to burn 2 lbs each and every night while they sleep.

    It's effective and it works all the time.

    Just follow these easy step:

    1) Go grab a clear glass and fill it up with water half glass

    2) And then follow this amazing HACK

    and be 2 lbs thinner in the morning!

    ReplyDelete