dotnet-nuget-add-source(1)
β¨ dotnet-nuget-add-source β¨
okay bestie, welcome to the dotnet-nuget-add-source(1) page from the .NET docs π this one lives in the dotnet manual, and it's the glow-up guide for getting a shiny new package source into your NuGet config. no cap.
This article applies to: βοΈ .NET 6 SDK and later versions
πΈ NAME πΈ
dotnet-nuget-add-source β add a NuGet source. that's it, that's the whole job π
π¨ bestie listen. Use package sources that you trust. literally rule number one. no random sources, no sketchy vibes.
π SYNOPSIS π
dotnet nuget add source <PACKAGE_SOURCE_PATH> [--name <SOURCE_NAME>] [--username <USER>]
[--password <PASSWORD>] [--store-password-in-clear-text]
[--valid-authentication-types <TYPES>] [--configfile <FILE>] [--allow-insecure-connections]
dotnet nuget add source -h|--help
π¦ DESCRIPTION π¦
the dotnet nuget add source command adds a brand new package source to your NuGet configuration files. that's the whole plot. you point it at a source, it goes in the config, done. iconic behavior honestly.
β οΈ WARNING: when adding multiple package sources, be careful not to introduce a dependency confusion vulnerability. like, fr fr, be careful. this is not a drill. π
π ARGUMENTS π
PACKAGE_SOURCE_PATHβ path to the package source. where the goodies live π
π OPTIONS π
--configfile <FILE>β the NuGet configuration file (nuget.config) to use. if you specify it, only the settings from this file get used, periodt. if you don't specify it, the hierarchy of configuration files from the current directory gets used instead. for more info, see Common NuGet Configurations.--allow-insecure-connectionsβ allows HTTP connections for adding or updating packages. bestie. this method is not secure. available since .NET 9 SDK π-n,--name <SOURCE_NAME>β name of the source. give it a cute name, you'll be typing it a lot.-p,--password <PASSWORD>β password to be used when connecting to an authenticated source.
heads up: encrypted passwords are only supported on Windows π and even then, they can only be decrypted on the same machine and by the same user who originally encrypted them. so like, it's giving very locked-down. keep that in mind.
--store-password-in-clear-textβ enables storing portable package source credentials by disabling password encryption.
β οΈ WARNING: storing passwords in clear text is strongly discouraged. for more information on managing credentials securely, refer to the security best practices for consuming packages from private feeds. please bestie. don't do it. π«Ά
-u,--username <USER>β username to be used when connecting to an authenticated source.--valid-authentication-types <TYPES>β comma-separated list of valid authentication types for this source. set this tobasicif the server advertises NTLM or Negotiate and your credentials must be sent using the Basic mechanism β for instance, when using a PAT with on-premises Azure DevOps Server. other valid values includenegotiate,kerberos,ntlm, anddigest, but ngl these values are unlikely to be useful. so. yeah. π
β¨ EXAMPLES β¨
here's where it gets fun, watch this π
- add
nuget.orgas a source:
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
- add
c:\packagesas a local source:
dotnet nuget add source c:\packages
- add a source that needs authentication:
dotnet nuget add source https://someServer/myTeam -n myTeam -u myUsername -p myPassword
- add a source that needs authentication (then go install credential provider):
dotnet nuget add source https://azureartifacts.microsoft.com/myTeam -n myTeam
slay. all four of those are valid and you're valid for reading them. π₯
π SEE ALSO π
- Security best practices for managing package source credentials
- Package source sections in NuGet.config files
- sources command (nuget.exe)
and that's the whole page bestie, you ate it, no crumbs π this was dotnet-nuget-add-source(1) from the .NET Documentation, dated 2025-10-30 β go add a source, stay safe, trust your feeds, and don't store passwords in clear text. mwah ππ¦β¨
π¦ where this page comes from
- alpine 3.24: dotnet-doc 10.0.303-r2 Β· MIT
- centos-stream 10: dotnet-host 11.0.0~rc.2.26504.105-0.10.el10 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- centos-stream 9: dotnet-host 11.0.0~rc.2.26504.105-0.11.el9 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 43: dotnet-host 10.0.12-1.fc43
- fedora 43: dotnet-host 11.0.0~rc.1.26425.128-0.10.fc43 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 44: dotnet-host 10.0.12-1.fc44
- fedora 44: dotnet-host 10.0.4-1.fc44 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- fedora 44: dotnet-host 11.0.0~rc.1.26425.128-0.12.fc44 Β· 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- nixpkgs unstable: dotnet-vmr 11.0.0-rc.3
- ubuntu noble: dotnet-host-10.0 10.0.12-0ubuntu1~24.04.1
- ubuntu questing: dotnet-host-10.0 10.0.9-0ubuntu1~25.10.1
- ubuntu resolute: dotnet-host-10.0 10.0.12-0ubuntu1~26.04.1
- ubuntu resolute: dotnet-host-10.0 10.0.5-0ubuntu1 Β· MIT
- ubuntu stonking: dotnet-host-10.0 10.0.12-0ubuntu2 Β· MIT
- ubuntu stonking: dotnet-host-11.0 11.0.0~rc1-0ubuntu1 Β· MIT
- ubuntu stonking: dotnet-host-11.0 11.0.0~rc3-0ubuntu1~26.10.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms