NuGet has problems with missing packages, how to restore?

When I try to compile my program I get the following error:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567.    

Now when I right click on the solution and press

All packages are already installed and there is nothing to restore.

I tried manually reinstalling every package which didn't solve the problem, I tried reinstalling NuGet but that didn't help either and I even tried reinstalling visual studio.

I also tried moving the package folder from the tfs folder to overwrite my package folder but that didn't solve anything. I also tried redownloading them with this package missing, that didn' t solve the problem either.

Anybody know how to restore the nuget packages?


Use Package Manager Console in Visual Studio to run this command.

1.This will restore all packages from solution

nuget restore YourSolution.sln

2.If you want to reinstall the packages to the same versions as were previously installed

Update-Package -reinstall

NuGet has problems with missing packages, how to restore?, An overview of how NuGet restores packages a project depends on, instructions described in Troubleshooting Package Restore errors or, If you see the error "This project references NuGet package(s) that are missing on� One or more NuGet packages need to be restored but couldn't be because consent has not been granted. To give consent, open the Visual Studio Options dialog, click on the NuGet Package Manager node and check 'Allow NuGet to download missing packages during build.'


Honestly, whoever developed the NuGet command for VS needs to go back to the drawing board. They totaly missed the fact that sometimes these DLL(s) and/or files get corrupt or deleted. a "NuGet Get-Packages -Force" option would really save their bacon. The only GAP I see is that VS and the Package console does not allow you to invoke a forced download from NuGet. Even clearing the cache via VS is useless.

NuGet Package Restore, Details about Problem Nuget package manager 4.6.0 Visual Studio Error This project references NuGet package(s) that are missing on this� When initially creating this solution, adding NuGet packages via the Visual Studio interface worked fine. Note however, the NuGet packages are excluded from my repo, expecting that any clones will pull their own fresh binaries. First, right-click on the solution and select Restore NuGet Packages. Nothing happens:


I ran into this issue when I tried to build my project on a computer where the packages-folder did not already exist in the solution root.

When the project file was initially created, it seems VS2019 added the following into the project file:

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>

From what I understand those settings are deprecated nowadays, no idea why VS inserted it in the first place.

Anyway, after removing those lines VS restored the packages and built the solution correctly again.

Restore not working in Visual Studio � Issue #7179 � NuGet/Home , Building a project throws this error: This project references NuGet package(s) that are missing on this computer. Enable NuGet Package� To restore packages listed in the project file with PackageReference, use the the msbuild -t:restore command. This command is available only in NuGet 4.x+ and MSBuild 15.1+, which are included with Visual Studio 2017 and higher versions. Both nuget restore and dotnet restore use this command for applicable projects.


It's probably a good idea to clear the Nuget Cache by deleting the contents within this directory: C:\Users\{your_username}\AppData\Local\NuGet

Nuget package restore not working vs2019 � Issue #8852 � NuGet , Last week we run into a strange problem with our build server. Restoring NuGet package Dapper.1.50.5. Restoring NuGet package Serilog.2.7.1. Adding package 'Serilog.2.7.1' to folder 'C:\agent2\_work\8\s\P*\packages' Details about Problem I'm trying to get the absolute simplest example of a .proj file that restores some nuget packages going. Ideally, this would let me use PackageReference instead of having a separate packages.config file.


Well it's probably a bad way but I found that it works if I just delete the line

http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />

from the project.csproj , not sure if this is going to cause problems later on but it works for now.

How to Fix Missing NuGet Packages in Azure DevOps – Improve , The build will fail because of missing NuGet packages (DLL files cannot be copied from the cache that has just been cleared, and the NuGet� I can see when I open the project the first time and try to build it that it tries to download nuget packages but then goes to show the error: This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them


restore nuget packages does nothing after cache clear, A NuGet package takes the form of a zip file with the extension .nupkg. You have two options here: If you want to update all the updates that are available, NuGet to download missing packages check box under Package Restore. If you encounter package installation problems or if you want to ensure� Go at References in visual studio and look at which packages are missing. Now right click on Solution in Visual and click on open folder in file explorer. Now open packages folder and delete missing packages folder. Open visual studio and just build the solution. all the missing packages will be restore.


How to Use NuGet Packages: The Ultimate Guide, Source(s) used: 'Sitefinity NuGet Server', 'nuget.org', 'Microsoft Visual Studio Offline Packages. The cause for this error is that NuGet cache conflicts with the build� NuGet package restore fail TFS Build Server If you don’t want to check-in packages into your source control system, you can enable package restore. This will automate the download of packages during build, if packages aren’t on the machine yet. After enabling this for a solution I’m working on, I had no problem running this locally.


Problem: Unable to resolve dependencies of NuGet packages, Occasionally I run into an issue where I'll open a solution in Visual Studio, I'll try every way offered by Visual Studio to restore packages, but it will that some packages are clearly missing (icons on the packages showing they're project to just build with the versions of packages it has in source control). The following packages do not exist under the Nuget packages folder for the active user profile, yet they have been flagged by NCrunch as potentially needed for normal operation. NCrunch has attempted to restore these files via an MSBuild restore step, which has either failed or not returned the expected result.