问题描述
我想知道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.
这篇关于Visual Studio项目中的NuGet.Config文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!