如何获取离线安装的所有 nuget 依赖项 [英] how to get all nuget dependencies for offline installation

查看:113
本文介绍了如何获取离线安装的所有 nuget 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台电脑,一台有互联网连接,另一台没有.

I two computers, one with internet connection and the other one without.

我想在离线计算机上安装 Nuget 包 (Nuget.server) 及其所有依赖项.不幸的是,仅下载包本身是不可能的,我必须手动下载所有依赖项,而且有很多依赖项.

I want to install a Nuget package (Nuget.server) with all its dependencies on the offline computer. Unfortunately it is not possible just to download the package itself and I have to download all dependencies manually and there are dozens of them.

如何在具有 Internet 连接的计算机上创建包含所有依赖项的包?

How can I create a package on the computer with internet connection that contains all dependencies?

谢谢.

推荐答案

在可以访问 Internet 的计算机上,NuGet 包 (.nupkg) 应位于本地计算机缓存中.在 Windows 上,它位于类似于以下内容的目录中:

On the computer with internet access the NuGet packages (.nupkg) should be in the local machine cache. On Windows this is in the directory similar to:

C:\Users\YourUsername\AppData\Local\NuGet\Cache

因此,您应该能够将 .nupkg 文件从那里复制到没有互联网访问权限的计算机上.我会在那台计算机上创建一个目录并设置一个指向该目录的新包源.或者,您可以将 .nupkg 文件复制到本地计算机缓存,但请注意缓存中的 NuGet 包限制为 200 个.然后就可以创建一个指向缓存的包源了.

So you should be able to copy the .nupkg files from there to the computer without internet access. I would create a directory on that computer and setup a new package source pointing to that directory. Alternatively you could copy the .nupkg files to the local machine cache, just be aware there is a limit of 200 NuGet packages in the cache. Then you can create a package source pointing to the cache.

这篇关于如何获取离线安装的所有 nuget 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆