简体   繁体   English

从Visual Studio外部安装NuGet包

[英]Installing NuGet package from outside of Visual Studio

I'm working on a project wich will create boilerplates for new websites, And based on what you select in the interface/GUI it will install certain modules to the new site. 我正在开发一个项目,它将为新网站创建样板,并根据您在界面/ GUI中选择的内容,将某些模块安装到新站点。

Therefore I want to use NuGet "outside" of visual studio to add this Modules and the references to the project/solution file. 因此,我想使用Visual Studio的“外部”NuGet添加此模块以及对项目/解决方案文件的引用

I have no problem installing packages to a certain path, it is just the references that I need to add to the solution. 我将包安装到某个路径没有问题,它只是我需要添加到解决方案的引用。

I wonder if anyone have done something similar and can give some guidance? 我想知道是否有人做过类似的事情并能提供一些指导?

Regards, Halle 此致,哈莉

If the NuGet packages just contain one or more assemblies that are added to your project references then adding the reference with custom code is probably the simplest way. 如果NuGet包只包含一个或多个添加到项目引用的程序集,那么添加带有自定义代码的引用可能是最简单的方法。

If the NuGet packages include content files, such as scripts, then you will need to add those too. 如果NuGet包中包含内容文件(如脚本),那么您还需要添加它们。

If the NuGet packages rely on PowerShell scripts then you could probably use a custom build of SharpDevelop . 如果NuGet包依赖于PowerShell脚本,那么您可以使用SharpDevelop的自定义构建。 This is a heavyweight solution since it requires most of SharpDevelop to do the work. 这是一个重量级的解决方案,因为它需要大部分SharpDevelop来完成这项工作。

There is also "nuget update" which should update to the latest versions of the packages, but it will not install them into a project from scratch. 还有“nuget update”应该更新到最新版本的软件包,但不会从头开始将它们安装到项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM