80

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.

sajadre
  • 1,141
  • 2
  • 15
  • 30
JatSing
  • 4,857
  • 16
  • 55
  • 65

3 Answers3

71
  1. First, download the .nupkg file:

  2. Secondly, install the .nupkg file into your project

Community
  • 1
  • 1
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
  • does nutake only work on nuget.org? I need to do the same thing on VSTS – doodlleus Aug 01 '16 at 14:32
  • @doodlleus From the description of the plugin: "Add 'download zip' links to package pages on the Nuget.org website." Based on that, I would assume it only works on NuGet.org – Michiel Bugher Nov 15 '17 at 22:58
10

You can use the NuGet Package Explorer to download packages outside VS.

JohnC
  • 1,797
  • 1
  • 18
  • 26
Bart
  • 101
  • 5
0

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.
Dariusz Woźniak
  • 9,640
  • 6
  • 60
  • 73