Skip to content

Commit 2c1b10d

Browse files
authored
Freshness Edit: NuGet (#3554)
* Refresh article and screenshots * Refresh article and screenshots * Refresh article, remove note from include, add note to other article * Adjust language * Address error: remove duplicate lightbox * Adjust language * Address Copilot comments: adjust capitalization and formatting * Address Copilot comment: adjust error example * Address review comment: remove Visual Studio steps for adding read-me file * Address review comments: remove DLL check, streamline code, follow readme convention, correct link
1 parent e2eeef4 commit 2c1b10d

15 files changed

Lines changed: 176 additions & 144 deletions

docs/nuget-org/Publish-a-package.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ To publish on nuget.org, sign in to nuget.org with a Microsoft account, and use
2222

2323
Once you have an account, you can publish a package to nuget.org by using the nuget.org web portal, the dotnet CLI, or the NuGet CLI version 4.1.0 or above. You can also publish packages through Azure Pipelines.
2424

25+
> [!NOTE]
26+
> If you want to publish your package on a test site before publishing it on nuget.org, you can use [https://int.nugettest.org](https://int.nugettest.org). Note that packages uploaded to int.nugettest.org might not be preserved.
27+
2528
### Upload to the nuget.org web portal
2629

2730
To upload a package to the nuget.org website:

docs/quickstart/create-and-publish-a-package-using-visual-studio.md

Lines changed: 139 additions & 111 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[!INCLUDE [publish-api-key](publish-api-key.md)]
22

3-
For more information, see [scoped API keys](../../nuget-org/scoped-api-keys.md).
3+
For more information, see [Scoped API keys](../../nuget-org/scoped-api-keys.md).
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
1. [Sign into your nuget.org account](https://www.nuget.org/users/account/LogOn?returnUrl=%2F) or [create an account](../../nuget-org/individual-accounts.md#add-a-new-individual-account) if you don't have one already.
1+
1. [Sign in to your nuget.org account](https://www.nuget.org/users/account/LogOn?returnUrl=%2F) or [create an account](../../nuget-org/individual-accounts.md#add-a-new-individual-account) if you don't have one already.
22

3-
1. Select your user name at upper right, and then select **API Keys**.
3+
1. In the upper-right corner, select your user name, and then select **API Keys**.
44

5-
1. Select **Create**, and provide a name for your key.
5+
1. Select **Create**, and then enter a name for your key.
66

77
1. Under **Select Scopes**, select **Push**.
88

9-
1. Under **Select Packages** > **Glob Pattern**, enter \*.
9+
1. Under **Select Packages**, for **Glob Pattern**, enter an asterisk (**\***).
1010

1111
1. Select **Create**.
1212

1313
1. Select **Copy** to copy the new key.
1414

15-
![Screenshot that shows the new API key with the Copy link.](../media/qs-create-api-key.png)
15+
:::image type="content" source="../media/qs-create-api-key.png" alt-text="Screenshot of a nuget.org page that shows the new API key, a message about copying the key now, and the Copy button, which is highlighted.":::
1616

1717
> [!IMPORTANT]
1818
>
19-
> - Always keep your API key a secret. The API key is like a password that allows anyone to manage packages on your behalf. Delete or regenerate your API key if it's accidentally revealed.
19+
> - Always keep your API key a secret. The API key is like a password that anyone can use to manage packages on your behalf. Delete or regenerate your API key if it's accidentally revealed.
2020
> - Save your key in a secure location, because you can't copy the key again later. If you return to the API key page, you need to regenerate the key to copy it. You can also remove the API key if you no longer want to push packages.
2121
22-
*Scoping* lets you create separate API keys for different purposes. Each key has an expiration timeframe, and you can scope the key to specific packages or glob patterns. You also scope each key to specific operations: Push new packages and package versions, push only new package versions, or unlist.
22+
*Scoping* provides a way to create separate API keys for different purposes. Each key has an expiration time frame, and you can scope the key to specific packages or glob patterns. You also scope each key to specific operations: Push new packages and package versions, push only new package versions, or unlist.
2323

2424
Through scoping, you can create API keys for different people who manage packages for your organization so they have only the permissions they need.
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
From the folder that contains the *.nupkg* file, run the following command. Specify your *.nupkg* filename, and replace the key value with your API key.
1+
From the folder that contains the *.nupkg* file, run the following command. Replace `<package-file>` with the name of your *.nupkg* file, and replace `<API-key>` with your API key.
22

33
```dotnetcli
4-
dotnet nuget push Contoso.08.28.22.001.Test.1.0.0.nupkg --api-key qz2jga8pl3dvn2akksyquwcs9ygggg4exypy3bhxy6w6x6 --source https://api.nuget.org/v3/index.json
4+
dotnet nuget push <package-file> --api-key <API-key> --source https://api.nuget.org/v3/index.json
55
```
66

77
The output shows the results of the publishing process:
88

99
```output
10-
Pushing Contoso.08.28.22.001.Test.1.0.0.nupkg to 'https://www.nuget.org/api/v2/package'...
10+
Pushing <package-file> to 'https://www.nuget.org/api/v2/package'...
1111
PUT https://www.nuget.org/api/v2/package/
12-
warn : All published packages should have license information specified. Learn more: https://aka.ms/nuget/authoring-best-practices#licensing.
13-
Created https://www.nuget.org/api/v2/package/ 1221ms
12+
Created https://www.nuget.org/api/v2/package/ 2891ms
1413
Your package was pushed.
1514
```
1615

1716
For more information, see [dotnet nuget push](/dotnet/core/tools/dotnet-nuget-push).
18-
19-
> [!NOTE]
20-
> If you want to avoid your test package being live on nuget.org, you can push to the nuget.org test site at [https://int.nugettest.org](https://int.nugettest.org). Note that packages uploaded to int.nugettest.org might not be preserved.
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
Errors from the `push` command typically indicate the problem. For example, you might have forgotten to update the version number in your project, so you're trying to publish a package that already exists.
1+
When you run the `push` command, you sometimes encounter an error. For instance, you might get an error in the following situations:
22

3-
You also see errors if your API key is invalid or expired, or if you try to publish a package using an identifier that already exists on the host. Suppose, for example, the identifier `AppLogger-test` already exists on nuget.org. If you try to publish a package with that identifier, the `push` command gives the following error:
3+
- Your API key is invalid or expired.
4+
- You try to publish a package that has an identifier that already exists on the host.
5+
- You make changes to a published package, but you forget to update the version number before you try to publish it again.
46

5-
```output
6-
Response status code does not indicate success: 403 (The specified API key is invalid,
7-
has expired, or does not have permission to access the specified package.).
8-
```
7+
The error message typically indicates the source of the problem.
98

10-
If you get this error, check that you're using a valid API key that hasn't expired. If you are, the error indicates the package identifier already exists on the host. To fix the error, change the package identifier to be unique, rebuild the project, recreate the *.nupkg* file, and retry the `push` command.
9+
For example, suppose the identifier `Contoso.App.Logger.Test` exists on nuget.org. If you try to publish a package with that identifier, you get the following error:
10+
11+
```output
12+
Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).
13+
```
14+
15+
To address this situation, check the scope, expiration date, and value of your API key. If the key is valid, the error indicates that the package identifier already exists on the host. To overcome the problem, change the package identifier to be unique, rebuild the project, re-create the *.nupkg* file, and retry the `push` command.

docs/quickstart/includes/publish-manage.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
When your package successfully publishes, you receive a confirmation email. To see the package you just published, on [nuget.org](https://www.nuget.org/), select your user name at upper right, and then select **Manage Packages**.
1+
When your package is successfully published, you receive a confirmation email. To see the published package, go to [nuget.org](https://www.nuget.org/), select your user name in the upper-right corner, and then select **Manage Packages**.
22

33
> [!NOTE]
4-
> It might take awhile for your package to be indexed and appear in search results where others can find it. During that time, your package appears under **Unlisted Packages**, and the package page shows the following message:
4+
> It might take a while for your package to be indexed and to appear in search results where others can find it. During that time, your package appears under **Unlisted Packages**, and the package page shows the following message:
55
>
6-
> ![Screenshot showing the publishing message that's displayed when you upload a package to nuget.org.](../media/qs-create-not-indexed.png)
6+
> :::image type="content" source="../media/qs-create-not-indexed.png" alt-text="Screenshot of a nuget.org warning message about the package not being published yet. The text states that validation and indexing can take an hour.":::
77
8-
You've now published a NuGet package to nuget.org that other developers can use in their projects.
8+
Now that your NuGet package is published at nuget.org, other developers can use it in their projects.
99

10-
If you've created a package that isn't useful (such as this sample package that was created with an empty class library), or you decide you don't want the package to be visible, you can *unlist* the package to hide it from search results:
10+
If you create a package that isn't useful (such as this sample package from an empty class library), or if you don't want the package to be visible, you can *unlist* the package to hide it from search results:
1111

1212
1. After the package appears under **Published Packages** on the **Manage Packages** page, select the pencil icon next to the package listing.
1313

14-
![Screenshot that shows the Edit icon for a package listing on nuget.org.](../media/qs-create-vs-edit-package.png)
14+
:::image type="content" source="../media/qs-create-vs-edit-package.png" alt-text="Screenshot of the nuget.org Packages page. The Published Packages section lists one package. Its edit icon is highlighted.":::
1515

16-
1. On the next page, select **Listing**, deselect the **List in search results** checkbox, and then select **Save**.
16+
1. On the next page, select **Listing**, clear the **List in search results** checkbox, and then select **Save**.
1717

18-
![Screenshot that shows clearing the List checkbox for a package on nuget.org.](../media/qs-create-vs-unlist-package.png)
18+
:::image type="content" source="../media/qs-create-vs-unlist-package.png" alt-text="Screenshot of a nuget.org page. In the Listing section, the option for listing the package in search results is highlighted.":::
1919

2020
The package now appears under **Unlisted Packages** in **Manage Packages** and no longer appears in search results.
2121

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
> [!NOTE]
22
>
3-
> - Nuget.org scans all uploaded packages for viruses and rejects the packages if it finds any viruses. Nuget.org also scans all existing listed packages periodically.
3+
> - Nuget.org scans all uploaded packages for viruses and rejects any packages that contain viruses. Nuget.org also scans all existing listed packages periodically.
44
>
5-
> - Packages you publish to nuget.org are publicly visible to other developers unless you unlist them. To host packages privately, see [Host your own NuGet feeds](../../hosting-packages/overview.md).
5+
> - Packages you publish to nuget.org are publicly visible to other developers unless you unlist them. To host packages privately, see [Hosting your own NuGet feeds](../../hosting-packages/Overview.md).
30.4 KB
Loading
-26.2 KB
Loading

0 commit comments

Comments
 (0)