3

I have a small project(I will add some files later). In VS,From Tools->NuGet Package Manager enter image description here

dir in my repo

Mode                 LastWriteTime         Length Name                                                                                  
----                 -------------         ------ ----                                                                                  
d-----         8/22/2021   3:28 PM                bin                                                                                   
d-----         8/22/2021   6:11 PM                obj                                                                                   
-a----         8/22/2021   6:12 PM           9563 Appointments.csproj                                                                   
-a----         8/20/2021   1:57 PM            344 Appointments.csproj.user                                                              
------         7/27/2021   7:13 AM           2100 Appointments.sln                                                                      
------         7/27/2021   7:13 AM           1749 Package.appxmanifest                                                                  
------         7/27/2021   7:13 AM           1985 SampleConfiguration.cs                                                                
------         7/27/2021   7:13 AM          12184 Scenario1_Define.xaml.cs                                                              
------         7/27/2021   7:13 AM           2334 Scenario2_Add.xaml.cs                                                                 
------         7/27/2021   7:13 AM           3991 Scenario3_Replace.xaml.cs                                                             
------         7/27/2021   7:13 AM           3387 Scenario4_Remove.xaml.cs                                                              
------         7/27/2021   7:13 AM           1475 Scenario5_Show.xaml.cs                                                                
------         7/27/2021   7:13 AM           6284 Scenario6_Recurrence.xaml.cs 

Nuget Packages for Solution

enter image description here

How to create a NuGet.config file in my repo?

MikiBelavista
  • 2,470
  • 10
  • 48
  • 70
  • Do you use custom nuget repositories? otherwise you do not need any NuGet.conf file since the global file is used. For more information follow https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file – Michael Mairegger Aug 23 '21 at 06:29
  • @MichaelMairegger I want to push code to Azure Devops, so I thought that NuGet.conf file could help in that case. – MikiBelavista Aug 23 '21 at 06:32
  • @MichaelMairegger I have only UWP, but maybe I will need more packages later. – MikiBelavista Aug 23 '21 at 06:36
  • 2
    If every package that you need can be found on nuget.org then you do not need to do anything. This is normally the case. – Michael Mairegger Aug 23 '21 at 06:48

1 Answers1

10

Assuming you have the .NET (Core) SDK installed, and therefore have the dotnet CLI available, run dotnet new nugetconfig in the directory you want the nuget.config file created.

I also recommend using the dotnet cli and/or nuget.exe to edit the file, or edit it with a text editor. The Visual Studio options dialog is not sophisticated enough to know which nuget.config file you want to add a source to (and doesn't provide a gui to edit any setting other than source), so you might find sources and added and deleted from nuget.config files you didn't intend if you use it.

zivkan
  • 12,793
  • 2
  • 34
  • 51