简体   繁体   中英

How to create NuGet.config for my project?

I have a small project(I will add some files later). In VS,From Tools->NuGet Package Manager在此处输入图像描述

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

在此处输入图像描述

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

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

I also recommend using the do.net 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM