Lately, I have been working on Visual Studio 2013 on Windows 7 to code as I had license to work on them and installed few years back. Previously I used to work on small projects that were easy to handle only using default components and packages. But as the complexity hit my project, I had to install things via NuGet Package Manager that contains a huge number of packages to install and for different version of .NET available.
But when I try to open the NuGet Package Manager from Tools > NuGet Package Manager > Manage NuGet Packages for Solution, it was completely stuck at retrieving information and was forever. Then I tried the Package Manager Console and pasted the install command, it stated “Unable to find package” nuget error. Then I looked for the solution everywhere and found the Visual Studio I was using was too old and needed some different URL but still didn’t work for my case. Even trying all the solutions from clearing NuGet caches, adding other sources didn’t help. Then I stumbled on an idea from an article that the problem could be from the SSL issue. The issue that is created because older version of Visual Studio connects to SSL from older protocol that was rejected by the server and it couldn’t connect to the nuget’s server. So I looked for modes to working for the package manager and found a temporary solution. Since the word temporary, you need to paste a command every time you need to work with the package manager and the command is simple as:
1 |
[Net.ServicePointManager]::SecurityProtocol=[Net.ServicePointManager]::SecurityProtocol-bOR [Net.SecurityProtocolType]::Tls12 |
And after that we specify that our SSL protocol to be TLS 1.2 which is still working for the nuget server and we are safe to work with. At some point or place there could be the setting for a permanent solution but I didn’t do enough research to work on that.