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条回答
再贱就再见
2楼-- · 2019-03-09 06:19

In visual studio 2017 please do following steps:

1) select Tool=>Options=>NuGet Package Manager=> Package Sources then uncheck Microsoft Visual Studio Offline Packages Option. enter image description here

2) now open Tool=>NuGet Package Maneger=>Package Manager Console. 3) execute command in PM>dotnet restore.

Hope its working...

查看更多
倾城 Initia
3楼-- · 2019-03-09 06:20

Cause of this defect: you have to remove the injected Nuget in file explorer. Solution: Once you remove that Nuget in your system, then remove from following location. select Tool=>Options=>NuGet Package Manager=> Package Sources then uncheck Microsoft Visual Studio Offline Packages Option

查看更多
冷血范
4楼-- · 2019-03-09 06:21

Select Tools > NuGet Package Manager > Package Manager Console

And then Run:

dotnet restore <project or solution name>
查看更多
兄弟一词,经得起流年.
5楼-- · 2019-03-09 06:22

If @mostafa-bouzari suggestion doesn't help, check carefully in 'Error list' or 'Output' windows for errors why NuGet cannot restore, e.g. because of net problem if you're behind proxy.

查看更多
Anthone
6楼-- · 2019-03-09 06:23

Another one, if by any chance you're using Dropbox, check for Conflicted in file names, do a search in your repo and delete all those conflicted files.

This may have happened if you have moved the files around.

查看更多
做自己的国王
7楼-- · 2019-03-09 06:25

In my case the error was the GIT repository. It had spaces in the name, making my project unable to restore

If this is your issue, just rename the GIT repository when you clone

git clone http://Your%20Project%20With%20Spaces newprojectname
查看更多
登录 后发表回答