Is there a way to download packages from nuget.org then do an offline installation into Visual Studio?

NugetNuget Package

Nuget Problem Overview


My visual studio is installed on a machine which doesn't have internet connection so I can't download and install packages from NuGet Manager in VS.
So I am looking for a way to use another machine which has internet connection to download packages and then install on VS.

Nuget Solutions


Solution 1 - Nuget

  1. First, download the .nupkg file:
  1. Secondly, install the .nupkg file into your project

Solution 2 - Nuget

Solution 3 - Nuget

Alternatively to proposed answers, you can:

  1. Build solution to restore packages (online).
  2. Refer to the packages folder in your NuGet.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
    <add key="Offline packages" value="offline-packages" />
  </packageSources>
</configuration>

NOTE that:

  1. NuGet.config should be in the same directory as your solution (*.sln) file.
  2. If you want to push packages to the repository, rename directory or remove **/packages/* from the .gitignore.
  3. In the above example, packages are moved to the offline-packages directory.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJatSingView Question on Stackoverflow
Solution 1 - NugetColonel PanicView Answer on Stackoverflow
Solution 2 - NugetBartView Answer on Stackoverflow
Solution 3 - NugetDariusz WoźniakView Answer on Stackoverflow