Visual Studio项目中的NuGet.Config文件在哪里? [英] Where is NuGet.Config file located in Visual Studio project?

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

问题描述

我想知道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%\NuGet uNuGet.Config ,它将在任何地方使用。

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

https://docs.microsoft.com/zh-CN/nuget/schema/nuget-config-file

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

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