I'm trying to use nopCommerce(Which is written in .NET Core) but when I want to run the project I face 52 Errors telling me Run a nuget package restore
Assets file ~\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. Nop.Web.MVC.Testsote
when I use the right click on the solution and selecting Restore Nuget Packages I get this message:
All packages are already installed and there is nothing to restore.
but those 52 Errors are still there and in Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution there is nothing installed on the solution,also I Recently updated my VS2017 to 15.5.4
To fix this error from Tools > NuGet Package Manager > Package Manager Console simply run:
dotnet restore
The error occurs because the dotnet cli does not create the all of the required files initially. Doing dotnet restore adds the required files.
This was also the fix for the build server. Added a Command Line step to run "dotnet restore" after normal NuGet restore.
You may do it from MSBuild also: msbuild MySolution.sln /t:Restore
@Der_Meister's solution to add the /t:Restore option worked for me, however, I had to build the solution twice (two separate build steps). First with the /t:Restore option and then again without it.
@Michael, try msbuild MySolution.sln /t:Restore;Build
If you have more than one solution file, you need to do
dotnet restore solutionfilename.sln