Command to download a Nuget package with all dependencies to a folder

后端 未结 2 1779
温柔的废话
温柔的废话 2020-12-12 01:31

Is there a windows command to download a Nuget packages with its dependencies to a folder so i can transfer them to an offline computer? What i mean is a command that i can

2条回答
  •  醉话见心
    2020-12-12 02:28

    You can use -OutputDirectory parameter of nuget.exe to specify a folder.

    example:

    nuget install NUnit -Version 3.11.0 -OutputDirectory c:\packages
    

    You need to have nuget.exe in the path enviroment or current folder which is cmd used on. This will output to unpacked dependencies and nukpg files to the selected folder. After this you can just copy the nukpg files to desired location by hand or you can use simple commandline copy script to copy only nukpg files.

    There is also a tool named nufetch. it will only download nukpg files, but this tool downloads unnecessary dependency files to. (I recommend using nuget)

提交回复
热议问题