Skip to content

Commit

Permalink
docs(nuget): rewrite, add admonitions, add headings (#18906)
Browse files Browse the repository at this point in the history
  • Loading branch information
HonkingGoose committed Nov 14, 2022
1 parent 68a329f commit 79889a7
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions docs/usage/nuget.md
Expand Up @@ -59,19 +59,26 @@ You can set alternative feeds:

In the example above we've set three NuGet feeds.
The package resolving process uses the `merge` strategy to handle the three feeds.
All feeds are checked for dependency updates, and duplicate updates are merged/joined together into a single dependency update.
All feeds are checked for dependency updates, and duplicate updates are merged into a single dependency update.

If your project uses lockfiles (a `package.lock.json` exists), alternate feed settings must be defined in a `NuGet.config` only, as `registryUrls` are not passed through to the NuGet commands used.
<!-- prettier-ignore -->
!!! warning
If your project has lockfile(s), for example a `package.lock.json` file, then you must set alternate feed settings in the `NuGet.config` file only.
`registryUrls` set in other files are **not** passed to the NuGet commands.

### Protocol versions

NuGet supports two protocol versions, `v2` and `v3`.
The NuGet client and server must use the same version.
When Renovate acts as the client, it can use the `v2` and `v3` protocols.

By default, Renovate uses the `v2` protocol.
If the configured feed URL ends with `index.json`, Renovate uses the `v3` protocol.
So Renovate behaves like the official NuGet client.

Renovate as a NuGet client supports both `v2` and `v3` protocols, and will use `v2` unless the configured feed URL ends with `index.json`.
This mirrors the behavior of the official NuGet client.
#### v3 feed URL not ending with index.json

If you have a `v3` feed that doesn't end with `index.json`, like for example on the JFrog Artifactory, then you must append `#protocolVersion=3` to the registry URL:
If a `v3` feed URL does not end with `index.json`, you must append `#protocolVersion=3` to the registry URL:

```json
{
Expand All @@ -81,6 +88,8 @@ If you have a `v3` feed that doesn't end with `index.json`, like for example on
}
```

You may need this workaround when you use the JFrog Artifactory.

## Authenticated feeds

Credentials for authenticated/private feeds can be given via host rules in the configuration options (file or command line parameter).
Expand All @@ -98,12 +107,12 @@ Credentials for authenticated/private feeds can be given via host rules in the c
}
```

When using Azure DevOps, you can use `pkgs.dev.azure.com` as `matchHost` value.
If you're using Azure DevOps, you can set `matchHost` to `pkgs.dev.azure.com`.

<!-- prettier-ignore -->
!!! note
Only Basic HTTP authentication (via username and password) is supported.
For Azure DevOps, you can use a Personal Access Token (PAT) with read permissions on `Packaging` along with an empty username.
For Azure DevOps, you can use a PAT with `read` permissions on `Packaging` plus an empty username.

## Future work

Expand Down

0 comments on commit 79889a7

Please sign in to comment.