[英]Visual Studio 2017 Nuget.config at solution folder not recognized
I'm having issue with visual studio 2017, 我在Visual Studio 2017上遇到问题,
where new solution keeps referencing the Nuget.config file in unexpected location in 'C:\\Users\\yopa\\AppData\\Roaming\\NuGet\\Nuget.config'. 新解决方案会在“ C:\\ Users \\ yopa \\ AppData \\ Roaming \\ NuGet \\ Nuget.config”中意外位置继续引用Nuget.config文件。
I've added '/.nuget/Nuget.config' file to my solutions folder. 我已经将'/.nuget/Nuget.config'文件添加到我的解决方案文件夹中。
However, the solution is still referencing the nuget configuration file in the 'C:\\', and the nuget packages are being restored in 'C:\\' package folder as well. 但是,解决方案仍在引用“ C:\\”中的nuget配置文件,并且nuget软件包也将还原到“ C:\\”软件包文件夹中。
How do I configure my solution to honour package.config file in its directory? 如何配置解决方案以遵守其目录中的package.config文件?
I've tried deleting the nuget.config file in the roaming folder, but the solution re-creates the file when nuget package restore is done. 我尝试删除漫游文件夹中的nuget.config文件,但是在完成nuget软件包还原后,该解决方案将重新创建该文件。
How do I configure my solution to honour package.config file in its directory?
如何配置解决方案以遵守其目录中的package.config文件?
To make sure your solution to honor the package.config file in the .nuget
folder, you should configure this file correctly, for example, I created a test sample solution, then add a Nuget.config
inside .nuget
folder: 为了确保您的解决方案
.nuget
文件夹中的package.config文件,您应该正确配置此文件,例如,我创建了一个测试示例解决方案,然后在.nuget
文件夹中添加了Nuget.config
:
My NuGet.Config
file: 我的
NuGet.Config
文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="D:\Test" />
</config>
</configuration>
Then, another important info is remember restart Visual Studio after adding the Nuget.config
file. 然后,另一个重要信息是记住在添加
Nuget.config
文件后重新启动Visual Studio 。
As test result, the nuget packages are being restored in 'D:\\Test' package folder: 作为测试结果,nuget软件包将还原到“ D:\\ Test”软件包文件夹中:
Looks like solution wide Nuget.config
inside .nuget
folder is no longer supported. 看起来像宽的解决方案
Nuget.config
内.nuget
文件夹不再支持。
NuGet 3.3 and earlier used a .nuget folder for solution-wide settings.
NuGet 3.3和更早版本使用.nuget文件夹进行解决方案范围的设置。 This file is not used in NuGet 3.4+.
NuGet 3.4+中未使用此文件。
Config file should be placed at the project level or any folder in the project path instead, check documentation for additional details Configuring nuget behavior . 配置文件应放置在项目级别或项目路径中的任何文件夹中,有关更多详细信息,请查阅文档。 配置nuget行为 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.