NuGet.Config 文件位于 Visual Studio 项目中的什么位置? [英] Where is NuGet.Config file located in Visual Studio project?

查看:30
本文介绍了NuGet.Config 文件位于 Visual Studio 项目中的什么位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 Visual Studio 2017 项目中的 NuGet.Config 文件在哪里?我试图在项目的根目录中创建我自己的 NuGet.Config 文件,但我没有找到任何新的存储库(NuGet 源).有人知道吗?

I am wondering where is NuGet.Config file located in Visual Studio 2017 project? I tried to create my own NuGet.Config file in the root of the project, but I didn't find any new repositories (NuGet sources). Does some one have any idea?

这是我试图为我的 .Net Core 项目实现的文件:

Here is the file I am trying to achieve for my .Net Core project:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
    <add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

推荐答案

Visual Studio 从解决方案根目录读取 NuGet.Config 文件.尝试将它移到那里,而不是将它放在与项目相同的文件夹中.

Visual Studio reads NuGet.Config files from the solution root. Try moving it there instead of placing it in the same folder as the project.

您也可以将文件放在 %appdata%NuGetNuGet.Config 中,它会在任何地方使用.

You can also place the file at %appdata%NuGetNuGet.Config and it will be used everywhere.

https://docs.microsoft.com/en-我们/nuget/schema/nuget-config-file

这篇关于NuGet.Config 文件位于 Visual Studio 项目中的什么位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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