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

后端 未结 30 905
孤城傲影
孤城傲影 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:39

    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

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

    When using VSTS, check your global.json file. I had entered the sdk version as just "2.2" which caused a parse error (but not when building locally). Adding the full version, "2.2.104" solved the problem.

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

    This worked for me: added this package source: Microsoft and .net https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/ then run "dotnet restore" in the console

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

    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.

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

    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.

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

    For me I upgraded NuGet.exe from 3.4 to 4.9 because 3.4 doesn't understand how to restore packages for .NET Core.

    For details please see dotnet restore vs. nuget restore with teamcity

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