更改 nuget 包文件夹并在 Visual Studio 中使用另一个 NuGet.Config [英] Change nuget packages folder and use another NuGet.Config in Visual Studio
问题描述
我想更改 nuget 包文件夹,但它不起作用.我尝试了很多技巧但没有奏效.我重启了很多次 VS 还是不行.
I want to change nuget package folder but it doesn't work. I tried very much tricks but not work. I restart many times VS but not work.
我的配置:
- Visual Studio 社区 2019
- Windows 10 1909 x64
我有一个 VS 解决方案文件夹
I have a VS solution folder
- MyProjectSln\
- HelloWorld\
- 斌
- nuget_packages
- NuGet.Config
我希望 VS studio nuget 包管理器控制台使用NuGet.Config"文件并将所有下载的包放入nuget_packages"
I want VS studio nuget package manager console use the "NuGet.Config" file and put all packages downloaded in "nuget_packages"
所以 nuget 包必须在 D:\MyProjetSln\HelloWorld\nuget_packages 中.
So nuget packages must be in D:\MyProjetSln\HelloWorld\nuget_packages.
D:\MyProjetSln\HelloWorld\NuGet.Config 的内容示例:
Content example of D:\MyProjetSln\HelloWorld\NuGet.Config :
<?xml version="1.0" encoding="UTF-8"?> <configuration> <config> <add key="globalPackagesFolder" value=".\nuget_packages" /> <!-- I have also tried with repositoryPath but not work --> </config> </configuration>
xml 语法在我的情况下是正确的(在我的文件中).
The xml syntax is correct in my case (in my file).
例如,当我执行命令install-package NUnit"时,从包管理器控制台,它把下载的包放在 D:\MyProjectSln\packages\ 中,我不想要那个.
Example, when i execute the command "install-package NUnit" from Package Manager Console, it put downloaded packages in D:\MyProjectSln\packages\ and I don't want that.
感谢您的帮助!
推荐答案
在撰写此消息时,我想要的暂时无法实现.
At the time of writing this message, what I want is not possible at the moment.
也许以后会有功能.
这篇关于更改 nuget 包文件夹并在 Visual Studio 中使用另一个 NuGet.Config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- HelloWorld\