1
votes

I'm getting an error in Visual studio 2017 when I build the solution.

"The package ComponentAce.Compression.Libs.zlib with version 1.0.4 could not be found in C:\Users\.nuget\packages. Run a NuGet package restore to download the package.".

My code is in .net 4.7.2 (C#,WPF)

I tried to install/uninstall/rebuild/clean and I also completely removed any references to that package in my code. Nothing's working. Any idea what's the issue here?

2
Hi, what's the vs version do you use? I mean Help=>About VS... Then you can find the current version, for now, the latest one is 15.9.16, please update your vs to latest version to check if it resolves the issue. - LoLance

2 Answers

2
votes

See Trouble-shooting nuget issues.

  1. You can clean the cache by VS IDE (Go Tools => Options => Nuget Package Manager => Settings => Clear Nuget caches). After that, clean and build current project again.

  2. If the issue persists, open your Solution directory => close VS instance => delete the .vs folder, and delete the bin and obj folders in Project directory. Then rebuild the project.

  3. If all above not helps, it could be one similar issue here, update VS2017 to latest 15.9.16 to fix it.

Update:

could not be found in C:\Users.nuget\packages

1.What does the specific path looks like? It should be C:\user\user-name\.nuget\packages by default, if the error you got is C:\Users\.nuget\packages, I think you may have a custom nuget.config file which causes this issue.

2.Also, you may create a new empty project and installing the missing packages in that project. Than closed the empty project, reopened the original one to run a rebuild. Hint from marco6.

-1
votes

Enable 'Allow Nuget to download missing packages' under Tools -> Options

enter image description here