将 NuGet 包安装到 Visual Studio 2015 项目中的自定义文件夹 [英] Installing NuGet packages to custom folder in a project in Visual Studio 2015

查看:37
本文介绍了将 NuGet 包安装到 Visual Studio 2015 项目中的自定义文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多项目的 Visual Studio 2015 解决方案.对于其中一个项目,我希望将 NuGet 中的文件下载到我的项目中的特定文件夹中.例如,我打算使用 Bootstrap 和 Signalr.我希望 Bootstrap 将所有内容下载到我的应用程序中的一个文件夹中,而不是在我的项目根目录中创建文件夹.例如,我在项目中有一个名为Libs"的文件夹,并希望这些库使用Libs"作为它们的根文件夹.这是由于外部构建解决方案处理Libs"文件夹中的所有内容.

I have a Visual Studio 2015 solution with many projects. For one of the projects I would like the files from NuGet to download to a specific folder in my project. For example, I intend to use Bootstrap and also Signalr. I would like Bootstrap to download everything into one folder in my application, and not create folders within my project root. For example, I have a folder called 'Libs' in the project and would like those libraries to use 'Libs' as their root folder. This is due to an external build solution that handles everything in the 'Libs' folder.

我发现这些文档关于使用 NuGet.config 文件夹解决方案,但这不能解决我的问题.有什么想法吗?

I've found these docs about using a NuGet.config folder for the solution, but this does not handle my problem. Any ideas?

推荐答案

据我所知,这是不可能的.每个 Nuget 包都写有关于如何安装到项目中的具体说明.这些指令之一是放置文件的位置,另一个示例是应用到 web.config 的转换.Nuget 没有指定修改这些指令的方法.您唯一能做的就是自己修改包 - 下载 .nupkg 文件并将其作为 zip 文件打开,您将能够从那里编辑文件夹结构.

As far as I'm aware, this isn't possible. Each Nuget package is written with specific instructions on how to install into a project. One of those instructions is where to put files, another example would be what transform to apply to the web.config. Nuget doesn't specify a way to modify these instructions. The only thing you could do would be to modify the packages yourself - download the .nupkg file and open it up as a zip file, you will be able to edit the folder structure from there.

这篇关于将 NuGet 包安装到 Visual Studio 2015 项目中的自定义文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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