Assets file project.assets.json not found. Run a N

2019-03-09 05:51发布

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

13条回答
Luminary・发光体
2楼-- · 2019-03-09 06:26

run your VS as administrator after that in package manager console run dotnet restore.

查看更多
小情绪 Triste *
3楼-- · 2019-03-09 06:29

I got the error when I created a lambda in dot net core in VS2017. What worked for me was to unload the project and load it back.

查看更多
戒情不戒烟
4楼-- · 2019-03-09 06:31

Closing and re-opening Visual Studio solved this issue for me, once I'd made sure the NuGet packages had been restored as per other answers posted here.

查看更多
相关推荐>>
5楼-- · 2019-03-09 06:31

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 Restore NuGet Packages again OR just REBUILD after deleting obj and bin folders.

查看更多
叼着烟拽天下
6楼-- · 2019-03-09 06:39

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.

查看更多
闹够了就滚
7楼-- · 2019-03-09 06:40

little late to the answer but seems this will add value. Looking at the error - it seems to occur in CI/CD pipeline.

Just running "dotnet build" will be sufficient enough.

dotnet build

dotnet build runs the "restore" by default.

查看更多
登录 后发表回答