Skip to content

Commit 8c7fca9

Browse files
author
Kraig Brockschmidt
authored
Merge pull request NuGet#263 from NuGet/kraigb
Adding packages.config reference; corrections
2 parents 606f610 + f615dcb commit 8c7fca9

8 files changed

+175
-84
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The NuGet documentation contained in this repository is hosted on docs.microsoft
44

55
Contributions to this docset are welcome. Please submit PRs to the *live* branch, which is what's published to the live docs site. (The master branch is used for staging larger series of changes.)
66

7+
NuGet follows the [.NET Foundation Contributors Code of Conduct](https://github.com/dotnet/home/blob/master/guidance/be-nice.md). Please take a few minutes to review it.
8+
79
## Respository structure
810

911
- All markdown files are in the docs folder and various subfolders.

docs/Guides/Install-NuGet.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Installing NuGet | Microsoft Docs
55
author: kraigb
66
ms.author: kraigb
77
manager: ghogen
8-
ms.date: 1/9/2017
8+
ms.date: 4/4/2017
99
ms.topic: article
1010
ms.prod: nuget
1111
#ms.service:
@@ -32,7 +32,7 @@ ms.reviewer:
3232

3333
There are two primary tools available to help you build, publish and consume NuGet packages:
3434

35-
1. The [**NuGet CLI**](#nuget-cli) is the command-line utility that works on Windows, Mac OS X, and Linux and supports all NuGet capabilities.
35+
1. The [**NuGet CLI**](#nuget-cli) is the command-line utility for Windows that provides all NuGet capabilities; it can also be run on Mac OSX and Linux through either the .NET Core CLI or with Mono.
3636
1. The [**NuGet Package Manager in Visual Studio**](#nuget-package-manager-in-visual-studio) is a GUI tool for managing packages and includes a console through which you can use certain NuGet commands directly within Visual Studio. It's included with Visual Studio 2012 and later and can be installed manually for earlier versions.
3737

3838
Both support the following operations:
@@ -60,7 +60,11 @@ The following capabilities are supported only in the NuGet CLI:
6060

6161
## NuGet CLI
6262

63-
The NuGet CLI can be installed using any of the following methods:
63+
The NuGet command-line interface provides access to all NuGet capabilities, and can be run on Windows, Mac OSX, and Linux as described in the following sections.
64+
65+
### Windows
66+
67+
On Windows, the NuGet CLI can be installed using any of the following methods:
6468

6569
1. **nuget.org**: Download the latest version of the nuget.exe file from [nuget.org/downloads](https://nuget.org/downloads) and save it to an appropriate location on your machine. If desired, add that location to your PATH environment variable so you can NuGet from anywhere. (Note that the download is a single .exe file, so save it rather than running it from the browser.)
6670

@@ -80,25 +84,33 @@ The NuGet CLI can be installed using any of the following methods:
8084
>
8185
> Because there are a few breaking changes introduced in NuGet 3.2, [https://nuget.org/nuget.exe](https://nuget.org/nuget.exe) points to the latest stable NuGet 2.x release to prevent CI systems from potentially breaking at this time.
8286

83-
### Compatibility with Mono
84-
85-
Though not fully-supported as yet, the NuGet command-line executable (version 3.2 and above) will run on Mac OS X and Linux systems when the Mono runtime is installed with a few limitations:
86-
87-
- Commands tested to work:
88-
- Config
89-
- Delete
90-
- Help
91-
- Install
92-
- List
93-
- Push
94-
- SetApiKey
95-
- Sources
96-
- Spec
97-
- Partially-working commands:
98-
- Pack: works with `.nuspec` files but not with project files.
99-
- Restore: works with `packages.config` and `project.json` files but not with solution (`.sln`) files.
100-
- Commands that do not work:
101-
- Update
87+
<a name="compatibility-with-mono"></a>
88+
89+
## Mac OSX and Linux
90+
91+
On Mac OSX and Linux, there are two ways to run NuGet:
92+
93+
1. Install the [.NET Core SDK](https://www.microsoft.com/net/download/core), which includes NuGet capabilities. Downloads are also listed on [github.com/dotnet/cli](https://github.com/dotnet/cli).
94+
95+
1. Install [Mono](http://www.mono-project.com/docs/getting-started/install/) and then use the nuget.exe command-line executable for Windows (version 3.2 and later) from [nuget.org/downloads](https://nuget.org/downloads). Running NuGet on Mono is subject to the following limitations:
96+
97+
- Commands tested to work:
98+
- Config
99+
- Delete
100+
- Help
101+
- Install
102+
- List
103+
- Push
104+
- SetApiKey
105+
- Sources
106+
- Spec
107+
108+
- Partially-working commands:
109+
- Pack: works with `.nuspec` files but not with project files.
110+
- Restore: works with `packages.config` and `project.json` files but not with solution (`.sln`) files.
111+
112+
- Commands that do not work:
113+
- Update
102114

103115

104116
### Related topics

docs/Schema/Target-Frameworks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ NuGet uses target framework references in a variety of places to specifically id
3434

3535
- [.nuspec manifest](../schema/nuspec.md): A package can indicate distinct packages to be included in a project depending on the project's target framework.
3636
- [.nupkg folder name](../create-packages/creating-a-package.md#from-a-convention-based-working-directory): The folders inside a package's `lib` folder can be named according to the target framework, each of which contains the DLLs and other content appropriate to that framework.
37+
- [packages.config](../Schema/packages-config.md): The `targetframework` attribute of a dependency specifies the variant of a package to install.
3738
- [project.json](../Schema/project-json.md): The `frameworks` node specifies the framework versions that the project can be compiled against.
3839

3940

docs/Schema/msbuild-targets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: NuGet pack and restore as MSBuild targets | Microsoft Docs
55
author: kraigb
66
ms.author: kraigb
77
manager: ghogen
8-
ms.date: 2/8/2017
8+
ms.date: 4/3/2017
99
ms.topic: article
1010
ms.prod: nuget
1111
#ms.service:
@@ -33,7 +33,7 @@ ms.reviewer:
3333

3434
NuGet 4.0+ can work directly with the information in a `.csproj` file without requiring a separate `.nuspec` or `project.json` file. All the metadata that was previously stored in those configuration files can be instead stored in the `.csproj` file directly, as described here.
3535

36-
With MSBuild 15.1+, NuGet is also a first-class MSBuild citizen with the `pack` and `restore` targets as described below. These targets allow you to work with NuGet as you would with any other MSBuild task or target.
36+
With MSBuild 15.1+, NuGet is also a first-class MSBuild citizen with the `pack` and `restore` targets as described below. These targets allow you to work with NuGet as you would with any other MSBuild task or target. (For NuGet 3.x and earlier, you use the [pack](../tools/nuget-exe-cli-reference.md#pack) and [restore](../tools/nuget-exe-cli-reference.md#pack) commands through the NuGet CLI instead.)
3737

3838
In this topic:
3939

docs/Schema/nuget-config-file.md

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ Contains miscellaneous configuration settings, which can be set using the [`nuge
6363

6464
Note: `dependencyVersion` and `repositoryPath` apply only to projects using `packages.config`. `globalPackagesFolder` applies only to projects using `project.json` and projects using the new Visual Studio 2017 project format.
6565

66-
Key | Value
67-
--- | ---
68-
dependencyVersion (package.config only) | The default `DependencyVersion` value for package install, restore, and update, when the `-DependencyVersion` switch is not specified directly. This value is also used by the NuGet Package Manager UI. Values are `Lowest`, `HighestPatch`, `HighestMinor`, `Highest`.
69-
globalPackagesFolder (projects not using `packages.config`) | The location of the default global packages folder. The default is `%userprofile%\.nuget\packages`. A relative path can be used in project-specific `Nuget.Config` files.
70-
repositoryPath (`packages.config` only) | The location in which to install NuGet packages instead of the default `$(Solutiondir)\packages` folder. A relative path can be used in project-specific `Nuget.Config` files.
71-
defaultPushSource | Identifies the URL or path of the package source that should be used as the default if no other package sources are found for an operation.
72-
http_proxy http_proxy.user http_proxy.password no_proxy | Proxy settings to use when connecting to package sources; `http_proxy` should be in the format `http://<username>:<password>@<domain>`. Passwords are encrypted and cannot be added manually. For `no_proxy`, the value is a comma-separated list of domains the bypass the proxy server. You can alternately use the http_proxy and no_proxy environment variables for those values. For additional details, see [NuGet proxy settings](http://skolima.blogspot.com/2012/07/nuget-proxy-settings.html) (skolima.blogspot.com).
66+
| Key | Value |
67+
| --- | --- |
68+
| dependencyVersion (package.config only) | The default `DependencyVersion` value for package install, restore, and update, when the `-DependencyVersion` switch is not specified directly. This value is also used by the NuGet Package Manager UI. Values are `Lowest`, `HighestPatch`, `HighestMinor`, `Highest`. |
69+
| globalPackagesFolder (projects not using `packages.config`) | The location of the default global packages folder. The default is `%userprofile%\.nuget\packages`. A relative path can be used in project-specific `Nuget.Config` files. |
70+
| repositoryPath (`packages.config` only) | The location in which to install NuGet packages instead of the default `$(Solutiondir)\packages` folder. A relative path can be used in project-specific `Nuget.Config` files. |
71+
| defaultPushSource | Identifies the URL or path of the package source that should be used as the default if no other package sources are found for an operation. |
72+
| http_proxy http_proxy.user http_proxy.password no_proxy | Proxy settings to use when connecting to package sources; `http_proxy` should be in the format `http://<username>:<password>@<domain>`. Passwords are encrypted and cannot be added manually. For `no_proxy`, the value is a comma-separated list of domains the bypass the proxy server. You can alternately use the http_proxy and no_proxy environment variables for those values. For additional details, see [NuGet proxy settings](http://skolima.blogspot.com/2012/07/nuget-proxy-settings.html) (skolima.blogspot.com). |
7373

7474

7575
**Example**:
@@ -88,9 +88,9 @@ http_proxy http_proxy.user http_proxy.password no_proxy | Proxy settings to use
8888

8989
Configures whether NuGet does automatic binding redirects when a package is installed.
9090

91-
Key | Value
92-
--- | ---
93-
skip | A Boolean indicating whether to skip automatic binding redirects. The default is false.
91+
| Key | Value |
92+
| --- | --- |
93+
| skip | A Boolean indicating whether to skip automatic binding redirects. The default is false. |
9494

9595
**Example**:
9696

@@ -106,10 +106,10 @@ skip | A Boolean indicating whether to skip automatic binding redirects. The def
106106

107107
Controls package restore during builds.
108108

109-
Key | Value
110-
--- | ---
111-
enabled | A Boolean indicating whether NuGet can perform automatic restore. You can also set the `EnableNuGetPackageRestore` environment variable with a value of `True` instead of setting this key in the config file.
112-
automatic | A Boolean indicating whether NuGet should check for missing packages during a build.
109+
| Key | Value |
110+
| --- | --- |
111+
| enabled | A Boolean indicating whether NuGet can perform automatic restore. You can also set the `EnableNuGetPackageRestore` environment variable with a value of `True` instead of setting this key in the config file. |
112+
| automatic | A Boolean indicating whether NuGet should check for missing packages during a build. |
113113

114114
**Example**:
115115

@@ -124,9 +124,9 @@ automatic | A Boolean indicating whether NuGet should check for missing packages
124124

125125
Controls whether the `packages` folder of a solution is included in source control. This section works only in `Nuget.Config` files in a solution folder.
126126

127-
Key | Value
128-
--- | ---
129-
disableSourceControlIntegration | A Boolean indicating whether to ignore the packages folder when working with source control. The default value is false.
127+
| Key | Value |
128+
| --- | --- |
129+
| disableSourceControlIntegration | A Boolean indicating whether to ignore the packages folder when working with source control. The default value is false. |
130130

131131

132132
**Example**:
@@ -148,9 +148,9 @@ The [`nuget sources` command](../tools/nuget-exe-cli-reference.md#sources) is ge
148148

149149
Lists all known package sources.
150150

151-
Key | Value
152-
--- | ---
153-
(name to assign to the package source) | The path or URL of the package source.
151+
| Key | Value |
152+
| --- | --- |
153+
| (name to assign to the package source) | The path or URL of the package source. |
154154

155155
**Example**:
156156

@@ -167,11 +167,11 @@ Key | Value
167167

168168
Stores usernames and passwords for sources, typically specified with the `-username` and `-password` switches with `nuget sources`. Passwords are encrypted by default unless the `-storepasswordincleartext` option is also used.
169169

170-
Key | Value
171-
--- | ---
172-
username | The user name for the source in plain text.
173-
password | The encrypted password for the source.
174-
cleartextpassword | The unencrypted password for the source.
170+
| Key | Value |
171+
| --- | --- |
172+
| username | The user name for the source in plain text. |
173+
| password | The encrypted password for the source. |
174+
| cleartextpassword | The unencrypted password for the source. |
175175

176176
**Example:**
177177

@@ -209,9 +209,9 @@ When using unencrypted passwords:
209209

210210
Stores keys for sources that use API key authentication, as set with the [`nuget setapikey` command](../tools/nuget-exe-cli-reference.md#setapikey).
211211

212-
Key | Value
213-
--- | ---
214-
(source URL) | The encrypted API key.
212+
| Key | Value |
213+
| --- | --- |
214+
| (source URL) | The encrypted API key. |
215215

216216
**Example**:
217217

@@ -226,9 +226,9 @@ Key | Value
226226

227227
Identified currently disabled sources. May be empty.
228228

229-
Key | Value
230-
--- | ---
231-
(name of source) | A Boolean indicating whether the source is disabled.
229+
| Key | Value |
230+
| --- | --- |
231+
| (name of source) | A Boolean indicating whether the source is disabled. |
232232

233233

234234

@@ -249,9 +249,9 @@ Key | Value
249249

250250
Identifies to the currently active source or indicates the aggregate of all sources.
251251

252-
Key | Value
253-
--- | ---
254-
(name of source) or `All` | If key is the name of a source, the value is the source path or URL. If `All`, value should be `(Aggregate source)` to combine all package sources that are not otherwise disabled.
252+
| Key | Value |
253+
| --- | --- |
254+
| (name of source) or `All` | If key is the name of a source, the value is the source path or URL. If `All`, value should be `(Aggregate source)` to combine all package sources that are not otherwise disabled. |
255255

256256
**Example**:
257257

@@ -274,32 +274,32 @@ Below is an example `NuGet.Config` file that illustrates a number of settings:
274274
<?xml version="1.0" encoding="utf-8"?>
275275
<configuration>
276276
<config>
277-
<!--
278-
Used to specify the default location to expand packages.
279-
See: nuget.exe help install
280-
See: nuget.exe help update
281-
-->
282-
<add key="repositoryPath" value="External\Packages" />
283-
284-
<!--
285-
Used to specify default source for the push command.
286-
See: nuget.exe help push
287-
-->
288-
289-
<add key="DefaultPushSource" value="https://MyRepo/ES/api/v2/package" />
290-
291-
<!-- Proxy settings -->
292-
<add key="http_proxy" value="host" />
293-
<add key="http_proxy.user" value="username" />
294-
<add key="http_proxy.password" value="encrypted_password" />
277+
<!--
278+
Used to specify the default location to expand packages.
279+
See: nuget.exe help install
280+
See: nuget.exe help update
281+
-->
282+
<add key="repositoryPath" value="External\Packages" />
283+
284+
<!--
285+
Used to specify default source for the push command.
286+
See: nuget.exe help push
287+
-->
288+
289+
<add key="DefaultPushSource" value="https://MyRepo/ES/api/v2/package" />
290+
291+
<!-- Proxy settings -->
292+
<add key="http_proxy" value="host" />
293+
<add key="http_proxy.user" value="username" />
294+
<add key="http_proxy.password" value="encrypted_password" />
295295
</config>
296296

297297
<packageRestore>
298-
<!-- Allow NuGet to download missing packages -->
299-
<add key="enabled" value="True" />
298+
<!-- Allow NuGet to download missing packages -->
299+
<add key="enabled" value="True" />
300300

301-
<!-- Automatically check for missing packages during build in Visual Studio -->
302-
<add key="automatic" value="True" />
301+
<!-- Automatically check for missing packages during build in Visual Studio -->
302+
<add key="automatic" value="True" />
303303
</packageRestore>
304304

305305
<!--
@@ -309,8 +309,8 @@ Below is an example `NuGet.Config` file that illustrates a number of settings:
309309
See: nuget.exe help update
310310
-->
311311
<packageSources>
312-
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
313-
<add key="MyRepo - ES" value="https://MyRepo/ES/nuget" />
312+
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
313+
<add key="MyRepo - ES" value="https://MyRepo/ES/nuget" />
314314
</packageSources>
315315

316316
<!-- Used to store credentials -->
@@ -326,7 +326,7 @@ Below is an example `NuGet.Config` file that illustrates a number of settings:
326326
See: nuget.exe help mirror
327327
-->
328328
<apikeys>
329-
<add key="https://MyRepo/ES/api/v2/package" value="encrypted_api_key" />
329+
<add key="https://MyRepo/ES/api/v2/package" value="encrypted_api_key" />
330330
</apikeys>
331331
</configuration>
332332
```

0 commit comments

Comments
 (0)