Search code examples
vb.nettwiliorestsharp

Twilio package missing many dependencies


I am very new to VB.net. I understand that I need to add the Twilio and RestSharp packages to my project via NuGet. After some strange behavior where the libraries disappear and reappear (like show up after a pc-reboot or restart of VS). Once found under the Browse tab pf the pckage manager, I ask to install them a number of packages are missing and despite some six hours of looking I cannot find a way to get those. The missing libraries include

  • System.identityModel.Tokens.jwt (>=6.15)
  • Microsoft.identityModel.Tokens (>=6.19)
  • System.Text.json (7.0.2)
  • System.collections.specialized (>=4.3)

I even found the fourth one in the Microsoft\SDK folder and tried to manually install it but VS says it refuses to look there due to "transitive" nature of the project.

Any help will be appreciated.


Solution

  • I found two ways to do this.

    1. Repeatedly try to install each package and follow down its respective rabbit hole tree-structure to get whatever dependencies its error message gave and install those individually from the PM> CLI using the install-package command, as in: install-package ["full path to the nupkg incl dbl quotes"]. This took about 2.5 hours to register ~30 libraries. All of this caused by the refusal of the VS to look at the folder you give it in the install-package command.

    Some of the libraries were already in the local SDK folder but, again, because VS refused to look there, they had to be manually copied to the top folder which the "source" entry had C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ but VS did not want to look any deeper than the top level. Many of the other packages had to be individually downloaded from nuget.org, and copied to the source folder.

    One must also pay attention to the version that the missing package is needed in the error message.

    1. After the horrendously-wasteful errand was done, I thought to add the nuget.org as a source itself: Tools|Nuget package manager|manage Nuget then gear-icon and under Nuget package manager select package-sources. click the green + button (top right) name it NUGET and here is the trick that had eluded me: the Source is https://api.nuget.org/v3/index.json . Then under Browse, if the source drop-down is specifically set to NUGET, then it will look for things there. However, I still don't know if NUGET has everything you need or some packages are strictly under the *C:\Program Files (x86)\Microsoft SDKs\NuGetPackages* local subfolder, nor am I sure it will automatically handle the dependencies, whence if not, it barely saves any time to add this source.

    Obviously, both of these are idiot-level "solutions" but it beat going beyond nine hours wasted over two days to install a package. If the instructions above are not clear please post a comment and I'll do my best to clarify as to what I did.