0
votes

I've never worked with VS and .NET before and I don't have much programming experience overall either (am a QA by trade, only gotten into test automation recently, which might explain the format of this question to you ;)), so I'm a bit out of my element here. I've tried all ideas that came to my mind and those that I saw in Google but still can't fix this on my own.

Steps

  1. Fresh install of VS 2019 via VS Installer from MS
  2. Clone repository from Bitbucket via VS; the repo includes a dependency on system.IO and System.Linq
  3. Attempt to Build Solution

Error result

Error NU3008 Package 'System.Linq 4.3.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. Error NU3008 Package 'System.IO 4.3.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed.

It works for a coworker, even if he checks out some code changes that I push out while having this error.

Attempted fixes

Delete caches through NuGet package manager UI, change to a different branch and see if it works there, remove and re-clone the repo, reinstall VS, update packages, wipe everything related to VS and .NET then reinstall, manually remove the System.io and System.linq DLLs then rebuild or update packages, modify components installed with VS, delete everything from %userprofile%.nuget\packages to force NuGet to redownload everything. Nothing helped.

My intuition is that the signature shipped from NuGet is out of date somehow? Since when I remove all local packages, clean cache, then make a new, clean project, literally with only 'Hello World' that auto-generates, and then only try to install the System.IO or System.Linq packages manually via package manager, I get the same error.

The question

Is there anything I can do here, something on my side that might be causing this, or do I need to contact NuGet?

1
That's something to do with the authenticity of the signed package - meaning that it thinks the package has been tampered with. I'm wondering if the package might have been slightly altered via some anti-virus immedialty after download or perhaps the files are ending up in the 'Blocked' state on your system. As a first step maybe grab a copy of the packages that your colleagues are using and transfer them to your project via flash drive. If those work then compare those ones with your original and take it from there.Mark Rabjohn
@MarkRabjohn somehow we never got the idea to do that :D thank you, it worked!DRA

1 Answers

0
votes

Just as this document said,

run nuget locals http-cache -clear and nuget locals -Clear all under Tools-->Nuget Package Manager-->Package Manager Console.

Besides, if it does not work, please try these:

1) close VS, delete nuget.config file from C:\Users\xxx(current user)\AppData\Roaming\NuGet,

delete .vs hidden folder of the solution folder, bin and obj folder of the project,

and then restart VS to regenerate that file to check whether it works.

2) change your nuget.org package source as http://packages.nuget.org/v1/FeedService.svc/ like this:

enter image description here

3) copy the nuget packages System.IO and System.Linq from your worked coworker's PC into your %userprofile%.nuget\packages. And then reinstall your nuget package there to check if this work.

4) download the latest nuget.exe v5.7.0 from this link and then configure it local path into System Environment Variable PATH so that it will be called from CMD.

You can check this link about the step.

Then, close VS and then restart your project, run these under Package Manager Console:

 nuget restore

5) Last, doing a clean uninstall might not be a good decision but it's worth a try.

Find C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe and run this program.

Note: it will uninstall all VS2017 and VS2019 versions on your PC and make a deep clean environment. If you don't mind these, you can run it.

When you finishing it, you can run the vs_installer to reinstall it. And after the installation, you can check the issue still persists.