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

后端 未结 30 901
孤城傲影
孤城傲影 2020-11-28 20:02

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

相关标签:
30条回答
  • 2020-11-28 20:37

    Select Tools > NuGet Package Manager > Package Manager Console

    And then Run:

    dotnet restore <project or solution name>
    
    0 讨论(0)
  • 2020-11-28 20:37

    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.

    0 讨论(0)
  • 2020-11-28 20:38

    This problem happening when your build tool is not set to do restore on projects set to use PackageReference vs packages.config and mostly affect Net Core and Netstandard new style projects.

    When you open Visual Studio and build, it resolves this for you. But if you use automation, CLI tools, you see this issue.

    Many solutions are offered here. But all you need to remember, you need to force restore. In some instances you use dotnet restore before build. If you build using MsBuild just add /t:Restore switch to your command.

    Bottom line, you need to see why restoring can't be activated. Either bad nuget source or missing restore action, or outdated nuget.exe, or all of the above.

    0 讨论(0)
  • 2020-11-28 20:39

    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
    
    0 讨论(0)
  • 2020-11-28 20:39

    It was mentioned earlier but I just wanted to re-emphasize the importance of not have space anywhere in your pathing! This is what was getting me. You've been warned.

    0 讨论(0)
  • 2020-11-28 20:39

    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.

    0 讨论(0)
提交回复
热议问题