简体   繁体   English

不为VS2015读取NuGet.Config文件?

[英]NuGet.Config file is not read for VS2015?

As far I've been able to figure out taking a look on docs.nuget.org , in order to be able to set my custom nuget repositories I need to set a NuGet.Config in whichever of these places: 到目前为止,我能够弄清楚docs.nuget.org ,以便能够设置我的自定义nuget存储库,我需要在以下NuGet.Config设置NuGet.Config

  • %APPDATA%\\NuGet\\Nuget.config
  • Solution folder 解决方案文件夹
  • Project folder 项目文件夹

So, I've created a NuGet.Config file with this content in my Project folder: 因此,我在Project文件夹中创建了具有以下内容的NuGet.Config文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <activePackageSource>
    <add key="Living" value="C:\NugetRepository" />
  </activePackageSource>
</configuration>

However, when I look at NuGet package sources list, my Living source doesn't appear. 但是,当我查看NuGet软件包来源列表时,我的Living来源没有出现。

Any ideas? 有任何想法吗?

The NuGet package sources list in Visual Studio is read the config from Global NuGet.config under %APPDATA%\\NuGet\\Nuget.config. Visual Studio中的NuGet包源列表是从%APPDATA%\\ NuGet \\ Nuget.config下的Global NuGet.config中读取的配置。 So if you want your Living source list in the NuGet Package Source list, please add your Package Source config in Global NuGet.config as below. 因此,如果要在“ NuGet软件包来源”列表中找到“生活来源”列表,请如下所示在“全局NuGet.config”中添加“软件包来源”配置。 Then please restart your Visual Studio. 然后,请重新启动 Visual Studio。

<configuration>
  <packageSources>
    <add key="Living" value="C:\NugetRepository" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <activePackageSource>
    <add key="Living" value="C:\NugetRepository" />
  </activePackageSource>
</configuration>

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

相关问题 通过使用我的 Nuget 包的 VS2015 构建 .NET 项目不会复制 .config 文件 - Building .NET project through VS2015 that uses my Nuget Package doesn't copy .config file 是否有将 nuget.exe 指向特定 NuGet.Config 文件的命令? - Is there a command to point nuget.exe to a specific NuGet.Config file? 无法为VS2015升级nuget - failed to upgrade nuget for VS2015 具有自定义源Azure函数的NuGet.Config文件 - NuGet.Config file with custom source Azure Function NuGet.Config 文件位于 Visual Studio 项目中的什么位置? - Where is NuGet.Config file located in Visual Studio project? VS2015诊断与代码修复 - NuGet或VSIX或两者? - VS2015 Diagnostic with Code Fix - NuGet OR VSIX OR both? 无法在VS2015中运行NuGet Package Command - Cannot run NuGet Package Command in VS2015 VS2015 NuGet私有软件包回购源未更新 - VS2015 NuGet private package repo source not updating 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.Config在VS2013和VS2017中都可以工作 - Configuring Nuget.Config to work in both VS2013 and VS2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM