Search code examples
c#visual-studio.net-corevisual-studio-2017visual-studio-2019

Where is NuGet.Config file located in Visual Studio project?


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?

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>

Solution

  • 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.

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

    https://learn.microsoft.com/en-us/nuget/schema/nuget-config-file