简体   繁体   English

无法识别解决方案文件夹中的Visual Studio 2017 Nuget.config

[英]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.

相关问题 更改 nuget 包文件夹并在 Visual Studio 中使用另一个 NuGet.Config - Change nuget packages folder and use another NuGet.Config in Visual Studio NuGet.Config 文件位于 Visual Studio 项目中的什么位置? - Where is NuGet.Config file located in Visual Studio project? 2015 visual studio Nuget程序包管理器不允许我保存新的程序包源,并且Nuget.Config无效的XML - 2015 visual studio Nuget package manager does not let me save new package sources and Nuget.Config is not valid XML 增加Nuget包版本NetStandard本地文件夹视觉工作室2017 - Increment Nuget Package Version NetStandard Local Folder visual studio 2017 Visual Studio 2017 找不到解决方案中存在的文件夹 - Visual Studio 2017 can't find folder that exists in the solution 如何在Visual Studio 2017解决方案中设置文件夹以在其中搜索DLL? - How to set folder in a visual studio 2017 solution for searching DLLs there? 配置Nuget.Config在VS2013和VS2017中都可以工作 - Configuring Nuget.Config to work in both VS2013 and VS2017 Visual Studio 2017(企业)上的 NUnit:Test Runner 仅作为扩展工作,而不是解决方案 NuGet 包? - NUnit on Visual Studio 2017 (Enterprise): Test Runner only works as Extension, not Solution NuGet package? nuget.config和gui设置之间是否存在连接? - Is there a connection between nuget.config and gui settings? 以编程方式将 packageSource 添加到 Nuget.Config 中的 packageSources - Programmatically Add a packageSource to packageSources in Nuget.Config
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM