NuGet Package Restore Not Working

后端 未结 20 1997
情书的邮戳
情书的邮戳 2020-12-02 04:06

I checked in a project on one computer, checked out on another, and find that the binaries installed by NuGet are missing. I could check them in to source control as well,

相关标签:
20条回答
  • 2020-12-02 05:06

    Did you enable package restore mode in the project that has the missing packages/binaries ? There's a known issue that requires the packages to be correctly installed when enabling the restore mode :

    http://nuget.codeplex.com/workitem/1879


    Original link is dead; this might be a replacement: https://github.com/NuGet/Home/issues/1968

    0 讨论(0)
  • 2020-12-02 05:06

    None of the other solutions worked in my situation:

    AspNetCore dependencies had been installed/uninstalled and were being cached. 'AspNetCore.All' would refuse to properly update/reinstall/remove. And regardless of what i did, it would use the cached dependencies (that it was not compatible with), because they were a higher version.

    1. Backup Everything. Note the list of Dependencies you'll need to reinstall, Exit VisualStudio
    2. Open up all .proj files in a text editor and remove all PackageReference
    3. In each project, delete the bin, obj folders
    4. Delete any "packages" folders you find in the solution.
    5. Open solution, go into Tools > Nuget Package Manager > Package Manager Settings and Clear all Nuget caches. Check the console because it may fail to remove some items - copy the folder path and exit visual studio.
    6. Delete anything from that folder Reopen solution and start installing nuget packages again from scratch.

    If that still doesn't work, repeat but also search your drive in windows explorer for nuget and delete anything cachey looking.

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