简体   繁体   中英

Nuget - Declare NuGet PackageSource in packages.config

Is there any way to declare in the file packages.config the private feed URL where to download the packages instead of using the %AppData%\\Roaming\\NuGet\\NuGet.Config ?

What is the best practice to avoid to configure it manually trought Visual Studio or editing the NuGet.config ?

As most of the users commented on my own question and as explained here ( https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior ) on the official documentation:

NuGet's behavior is driven by the accumulated settings in one or more NuGet.Config (XML) files that can exist at project-, user-, and computer-wide levels. A global NuGetDefaults.Config file also specifically configures package sources. Settings apply to all commands issued in the CLI, the Package Manager Console, and the Package Manager UI.

So you can specify additional feeds (packageSources) by a NuGet.config file that exist at source code file level (ex .csproj).

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