Skip to content

Commit 859b29a

Browse files
author
Kraig Brockschmidt
committed
Update config locations issue 212
https://github.com/NuGet/docs.microsoft.com-nuget/issues/212 And date on CLI ref
1 parent 4297c1a commit 859b29a

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docs/Consume-Packages/Configuring-NuGet-Behavior.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Configuring the behavior of NuGet | Microsoft Docs
55
author: kraigb
66
ms.author: kraigb
77
manager: ghogen
8-
ms.date: 1/9/2017
8+
ms.date: 3/27/2017
99
ms.topic: article
1010
ms.prod: nuget
1111
#ms.service:
@@ -46,11 +46,15 @@ The behavior of every NuGet command, whether issued from the command line, the P
4646
- Project-specific `NuGet.Config` files located in any folder from the solution folder up to the drive root. These allow control over settings as they apply to a project or a group of projects.
4747
- A solution-specific `NuGet.Config` file located within a `.nuget` folder in the solution. Settings in this file apply only to solution-wide packages and is supported only in NuGet 3.3 and earlier. It is ignored for NuGet 3.4 and later.
4848
- The global config file located in `%APPDATA%\NuGet\NuGet.Config`, which is always used unless you specify a different config file using the `-configFile` switch on any NuGet command. For example, `nuget restore -configfile c:\my.config` will use settings from `c:\my.config` for the command and ignores any settings in the global config file.
49-
- Additional machine-wide config files (NuGet 2.6 and later) located in `%ProgramData%\NuGet\Config[\{IDE}[\{Version}[\{SKU}\]]]NuGet.Config`, where `{IDE}` can be `VisualStudio`, `{Version}` can be the Visual Studio version such as `14.0`, and `{SKU}` is either `Community`, `Pro`, or `Enterprise`. These variants allow you to create configurations that are specific to different versions and editions of Visual Studio if needs be.
50-
- (NuGet 2.7 and later) The "defaults" file located at `%PROGRAMDATA%\NuGet\NuGetDefaults.Config`, which is described later under [NuGet defaults file](#nuget-defaults-file) as a way to specifically enable and disable package sources. No other settings are supported in this file.
49+
- Additional machine-wide config files:
50+
- NuGet 2.6 to NuGet 3.5: located in `%ProgramData%\NuGet\Config[\{IDE}[\{Version}[\{SKU}\]]]NuGet.Config`, where `{IDE}` can be `VisualStudio`, `{Version}` can be the Visual Studio version such as `14.0`, and `{SKU}` is either `Community`, `Pro`, or `Enterprise`. These variants allow you to create configurations that are specific to different versions and editions of Visual Studio if needs be.
51+
- NuGet 4.0+: located under `%ProgramFiles(x86)%\NuGet\Config` rather than `%ProgramData%`.
52+
- The "default" file:
53+
- NuGet 2.7 to NuGet 3.5: located at `%PROGRAMDATA%\NuGet\NuGetDefaults.Config`, which is described later under [NuGet defaults file](#nuget-defaults-file) as a way to specifically enable and disable package sources. No other settings are supported in this file.
54+
- NuGet 4.0+: located under `%ProgramFiles(x86)%\NuGet\Config` rather than `%ProgramData%`.
5155

5256
> [!Note]
53-
> The `%ProgramData%\NuGet` folder typically requires Administrator permissions to modify. Administrators are expected to set the correct permissions on this folder based on the user and/or machine information.
57+
> The `%ProgramData%\NuGet` and `%ProgramFiles(x86)\NuGet` folders typically requires Administrator permissions to modify. Administrators are expected to set the correct permissions on these folders based on the user and/or machine information.
5458
5559
## Changing config settings
5660

@@ -101,7 +105,7 @@ As described above in [Config file locations and uses](#config-file-locations-an
101105
102106
When `nuget.exe` is run from the command line or run implicitly within Visual Studio, it loads settings from config files in the following order:
103107

104-
1. Files in `%ProgramData%\NuGet\Config` starting at this top folder and iterating down through the `{IDE}\{Version}\{SKU}\` subfolders if they exist.
108+
1. Files in `%ProgramData%\NuGet\Config` (NuGet 3.5 and earlier) or `%ProgramFiles(x86)%\NuGet\Config` (NuGet 4.0+) starting at this top folder and iterating down through the `{IDE}\{Version}\{SKU}\` subfolders if they exist.
105109
1. The global config file, except in NuGet 3.4 and later if `-configFile` is used on the command line.
106110
1. The file specified with `-configFile`.
107111
1. Files found in the path to the current folder (where nuget.exe is invoked or the folder containing the Visual Studio solution), starting from the root and ending in the current folder.
@@ -136,12 +140,18 @@ It can also help to think about the "priority order" in which settings are appli
136140
(Ignored in NuGet 3.4 and later if -configFile is used)
137141
%AppData%\NuGet\NuGet.Config
138142

139-
(NuGet 2.6 and later)
143+
(NuGet 2.6 to 3.5)
140144
%ProgramData%\NuGet\Config\{IDE}\{Version}\{SKU}\NuGet.Config
141145
%ProgramData%\NuGet\Config\{IDE}\{Version}\NuGet.Config
142146
%ProgramData%\NuGet\Config\{IDE}\NuGet.Config
143147
%ProgramData%\NuGet\Config\NuGet.Config
144148

149+
(NuGet 4.0+)
150+
%ProgramFiles(x86)%\NuGet\Config\{IDE}\{Version}\{SKU}\NuGet.Config
151+
%ProgramFiles(x86)%\NuGet\Config\{IDE}\{Version}\NuGet.Config
152+
%ProgramFiles(x86)%\NuGet\Config\{IDE}\NuGet.Config
153+
%ProgramFiles(x86)%\NuGet\Config\NuGet.Config
154+
145155
### Settings walkthrough
146156

147157
Let's say you have the following folder structure:
@@ -222,7 +232,7 @@ Here's how NuGet will load and apply the settings, depending on where it's invok
222232

223233
## NuGet defaults file
224234

225-
NuGet 3.3 and earlier uses a hardcoded default package source, nuget.org, that the user could not delete. However, when using NuGet with internal package sources, it's often desirable to make sure that developers and build servers use packages from those sources instead of nuget.org. With NuGet 2.7 and later, you can use the `%PROGRAMDATA%\NuGet\NuGetDefaults.Config` file to control certain machine-wide defaults described below. This provides administrators a convenient way to deploy (using Group Policy, for example) consistent `NuGetDefaults.Config` files to developer and build machines, thus ensuring correct use of package sources.
235+
NuGet 3.3 and earlier uses a hardcoded default package source, nuget.org, that the user could not delete. However, when using NuGet with internal package sources, it's often desirable to make sure that developers and build servers use packages from those sources instead of nuget.org. With NuGet 2.7 to 3.5, you can use the `%ProgramData%\NuGet\NuGetDefaults.Config` file (or `%ProgramFiles(x86)%\NuGet\NuGetDefaults.Config` with NuGet 4.0+) to control certain machine-wide defaults described below. This provides administrators a convenient way to deploy (using Group Policy, for example) consistent `NuGetDefaults.Config` files to developer and build machines, thus ensuring correct use of package sources.
226236

227237
Note that NuGet 3.4 and later does not use a hardcoded default source. When nuget.exe is run for the first time, `NuGet.Config` is generated and nuget.org is added as the default package source in the config file. In the absence of the `NuGet.Config` file, the default package source is undefined.
228238

docs/Tools/nuget-exe-CLI-Reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: NuGet Command-Line Interface (CLI) Reference | Microsoft Docs
55
author: kraigb
66
ms.author: kraigb
77
manager: ghogen
8-
ms.date: 1/9/2017
8+
ms.date: 3/28/2017
99
ms.topic: article
1010
ms.prod: nuget
1111
#ms.service:

0 commit comments

Comments
 (0)