Q:

I deleted my packages folder now I can't build in VS2019

I was having trouble with a dependency downgrade error (as it turned out, due to a bad git conflict resolution I had two references for the same package in the csproj file with different versions - anyway, not the issue).  
One of the things I tried while attempting to discover this was deleting the package cache from %userprofile%\.nuget\packages - I deleted the entire packages folder.  
I then discovered there were duplicate package references in the csproj file and thought "ok, I'll just remove the duplicate and do a dotnet restore Blah.sln and all will well.  Nope.  I kept getting a build error:
metadata file microsoft.codeanalysis.analyzers.dll could not be found

A:

After a lot of Googling, it turns out that to solve this issue I needed to open the solution in VS2017 and run a rebuild command.  Doing this restored the required packages and I was then able to build successfully in VS2019 
This issue led me to the answer, although isn't specific to the issue I was having necessarily

