This article is a mirror article of machine translation, please click here to jump to the original article.

View: 6945|Reply: 5

[Source] Learn to create and release NuGet packages in 3 minutes

[Copy link]
Posted on 9/12/2022 9:57:24 PM | | | |
Requirements: In daily development, third-party library packages are often used, and this article will introduce creating a NuGet package from the .NET Standard library in Visual Studio on Windows and publishing it towww.nuget.orgAbove, make your plugin available to more .NET/C# developers.

Review:

Practical Operation: Use ProGet to build a NuGet private repository
https://www.itsvse.com/thread-10263-1-1.html

Nuget packages multiple libraries into a package
https://www.itsvse.com/thread-9656-1-1.html

Azure DevOps 2020 (V) Automate the release of NUGET packages using Pipelines
https://www.itsvse.com/thread-9381-1-1.html

Nuget Series 2 uses BaGet to build private Nuget services
https://www.itsvse.com/thread-9380-1-1.html

Nuget Series 1 uses asp.net to build a private Nuget repository
https://www.itsvse.com/thread-9368-1-1.html

Nuget sets up HTTP proxy access
https://www.itsvse.com/thread-9287-1-1.html

Use Tencent Cloud Nuget Package Manager to speed up downloads
https://www.itsvse.com/thread-7875-1-1.html

[VS2017] Set up the Nuget agent
https://www.itsvse.com/thread-4231-1-1.html

Nuget Domestic Source (Mirror Source)
https://www.itsvse.com/thread-3925-1-1.html
NuGet.org Overview

NuGet.org is the public host for NuGet packages and is used by millions of .NET and .NET Core developers every day.

Sign up for a Microsoft account

To create a NuGet.org account, you need to have a Microsoft Personal Account (MSA) or Azure Active Directory (AAD) account. If you don't have an account, create one.

The hyperlink login is visible.

If you have already registered, visit the NuGet.org login page:The hyperlink login is visible.

Create a project

I created a .NET Standard library project using vs2019 as shown below:



In the project, write your own code, and that goes without saying.

Right-click on the item, select the Properties menu command, and then select the Packaging tab. As shown below:



According to the prompt information, fill in the corresponding text input box.



In the top toolbar, select the "Release" configuration, then right-click on the project, click "Package", and the output information is as follows:

1>------ Build started: Project: Sw.Core.Common, Configuration: Release Any CPU ------
1>Sw.Core.Common -> C:\Users\DELL\source\repos\Sw.Core.Common\bin\Release\netstandard2.1\Sw.Core.Common.dll
1> Package "C:\Users\DELL\source\repos\Sw.Core.Common\bin\Release\Sw.Core.Common.Common.1.0.0.nupkg" has been successfully created.
========== Generated: 1 success, 0 failed, 0 latest, 0 skipped ==========
Upload to NuGet

Using a Microsoft account, sign in to the NuGet app and authorize as follows:



Click Upload in the navigation bar, link:

The hyperlink login is visible.



Select "Sw.Core.Common.1.0.0.nupkg" for the release package we generated.

Pull to the bottom and click Publish.



The browser will be redirected to the link after the release was successful, and it will prompt that the package has not yet been published. It will appear in the search results and will be available for installation/restore once validation and indexing are complete. Package validation and indexing can take up to an hour. Read more.

Links after successful publication:

The hyperlink login is visible.

You can configure some instructions for the nuget package, modify the .csproj configuration as follows:

(End)





Previous:Chrome Google Chrome unsubscribes notifications for messages
Next:[Actual combat] State Secret 4 (SM4) uses .NET and Java to decrypt each other
Posted on 9/12/2022 11:19:49 PM |
Learn it
 Landlord| Posted on 11/13/2022 4:02:17 PM |
NUGET packages the .NET Framework version of the library:

1. Download the nuget.exe program at the address:https://www.nuget.org/downloads
2. Right-click on the nuget.exe program to unblock it.
3. The command is as follows:

where xxxxx is the project name
 Landlord| Posted on 10/22/2023 10:16:30 PM |
Best practices for creating nuget packages:The hyperlink login is visible.
 Landlord| Posted on 9/9/2025 9:10:25 AM |
NuGet Package Explorer

A graphical tool that allows you to view the structure, dependencies, and more of a local or remote NuGet package.

Source:The hyperlink login is visible.
Download:The hyperlink login is visible.

As shown below:

 Landlord| Posted on 9/29/2025 1:26:19 PM |
Use the dotnet command to package the push

Reference:The hyperlink login is visible.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com