如何在项目中包含nuget包以使项目可移植 [英] How to include nuget packages in a project to make the project portable

查看:86
本文介绍了如何在项目中包含nuget包以使项目可移植的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据,我决定使用nuget在项目中.我想使其成为便携式"-在git存储库中添加使用过的包,并要求在服务器端没有Internet连接.怎么做呢?

According to this, I decided to use nuget in the project. I would like to make it "portable" - add the used packages in the git repository and requiering no internet connection on the server side. What is the way to do it?

推荐答案

您应该将路径添加到存储库的本地副本,将NuGet位置添加到选项-> NuGet软件包管理器->软件包源,并从此安装NuGet位置,而不是从服务器或其他任何位置进行安装.

You should add path to the local copy of the repository, your NuGet location to the Options -> NuGet Package Manager -> Package Sources and install the NuGet from this location instead of installing it from the server or anywhere else.

在构建项目时Visual Studio使用的NuGet.config文件中具有NuGet文件的位置,将从指定位置下载所需的软件包.

Having the location of your NuGet files inside the NuGet.config file which is used by Visual Studio when building the project, will download the needed packages from the specified location.

这篇关于如何在项目中包含nuget包以使项目可移植的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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