Commit 77f7a265 authored by Suzanne Selhorn's avatar Suzanne Selhorn

Merge branch 'selhorn-nuget-updates' into 'master'

Added endpoint and duplicate info

See merge request gitlab-org/gitlab!52027
parents 0a56d9a2 080fdbba
...@@ -106,6 +106,9 @@ You can now add a new source to NuGet with: ...@@ -106,6 +106,9 @@ You can now add a new source to NuGet with:
#### Project-level endpoint #### Project-level endpoint
A project-level endpoint is required to publish NuGet packages to the Package Registry.
A project-level endpoint is also required to install NuGet packages from a project.
To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with `nuget`: To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with `nuget`:
```shell ```shell
...@@ -122,6 +125,8 @@ nuget source Add -Name "GitLab" -Source "https://gitlab.example.com/api/v4/proje ...@@ -122,6 +125,8 @@ nuget source Add -Name "GitLab" -Source "https://gitlab.example.com/api/v4/proje
#### Group-level endpoint #### Group-level endpoint
To install a NuGet package from a group, use a group-level endpoint.
To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with `nuget`: To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with `nuget`:
```shell ```shell
...@@ -140,6 +145,9 @@ nuget source Add -Name "GitLab" -Source "https://gitlab.example.com/api/v4/group ...@@ -140,6 +145,9 @@ nuget source Add -Name "GitLab" -Source "https://gitlab.example.com/api/v4/group
#### Project-level endpoint #### Project-level endpoint
A project-level endpoint is required to publish NuGet packages to the Package Registry.
A project-level endpoint is also required to install NuGet packages from a project.
To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with Visual Studio: To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with Visual Studio:
1. Open [Visual Studio](https://visualstudio.microsoft.com/vs/). 1. Open [Visual Studio](https://visualstudio.microsoft.com/vs/).
...@@ -167,6 +175,8 @@ If you get a warning, ensure that the **Location**, **Username**, and ...@@ -167,6 +175,8 @@ If you get a warning, ensure that the **Location**, **Username**, and
#### Group-level endpoint #### Group-level endpoint
To install a package from a group, use a group-level endpoint.
To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with Visual Studio: To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endpoint, add the Package Registry as a source with Visual Studio:
1. Open [Visual Studio](https://visualstudio.microsoft.com/vs/). 1. Open [Visual Studio](https://visualstudio.microsoft.com/vs/).
...@@ -196,6 +206,9 @@ If you get a warning, ensure that the **Location**, **Username**, and ...@@ -196,6 +206,9 @@ If you get a warning, ensure that the **Location**, **Username**, and
#### Project-level endpoint #### Project-level endpoint
A project-level endpoint is required to publish NuGet packages to the Package Registry.
A project-level endpoint is also required to install NuGet packages from a project.
To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) Package Registry as a source for .NET: To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) Package Registry as a source for .NET:
1. In the root of your project, create a file named `nuget.config`. 1. In the root of your project, create a file named `nuget.config`.
...@@ -219,6 +232,8 @@ To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) Package ...@@ -219,6 +232,8 @@ To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) Package
#### Group-level endpoint #### Group-level endpoint
To install a package from a group, use a group-level endpoint.
To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) Package Registry as a source for .NET: To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) Package Registry as a source for .NET:
1. In the root of your project, create a file named `nuget.config`. 1. In the root of your project, create a file named `nuget.config`.
...@@ -326,8 +341,19 @@ updated: ...@@ -326,8 +341,19 @@ updated:
1. Commit the changes and push it to your GitLab repository to trigger a new CI/CD build. 1. Commit the changes and push it to your GitLab repository to trigger a new CI/CD build.
### Publishing a package with the same name or version
When you publish a package with the same name or version as an existing package,
the existing package is overwritten.
## Install packages ## Install packages
To install a NuGet package from the Package Registry, you must first
[add a project-level or group-level endpoint](#add-the-package-registry-as-a-source-for-nuget-packages).
If multiple packages have the same name and version, when you install
a package, the most recently-published package is retrieved.
### Install a package with the NuGet CLI ### Install a package with the NuGet CLI
WARNING: WARNING:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment