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

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

    To those with the same issue as me in Azure DevOps / VSTS environment encountering a similar message: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): Error NETSDK1004: Assets file '...\obj\project.assets.json' not found. Run a NuGet package restore to generate this file

    Add /t:Restore to your MSBuild Arguments in Build Solution.

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

    Nothing above worked for me. But simply deleting all 'bin' and 'obj' folders did the trick.

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

    Seen this after adding a WinForms Core 3.1 project (from project templates) on VS-2019 vs 16.4.0 and trying to run it out of the box. Clean or Rebuild the entire solution did not work.

    I just reloaded my solution.. that is File/Close Solution and then reopening it and rebuilding it solved the problem.

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

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

    Try this (It worked for me):

    • Run VS as Administrator
    • Manual update NuGet to most recent version
    • Delete all bin and obj files in the project.
    • Restart VS
    • Recompile
    0 讨论(0)
  • 2020-11-28 21:01

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

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