How to Publish a NuGet Package
How to Publish a NuGet Package
Command line
To push packages to nuget.org you must use nuget.exe v4.1.0 or above, which implements the required NuGet protocols. You also need an API key, which is created on nuget.org.
Create API keys
-
Sign into your nuget.org account or create an account if you don't have one already.
For more information on creating your account, see Individual accounts.
-
Select your user name (on the upper right), then select API Keys.
-
Select Create, provide a name for your key, select Select Scopes > Push. Enter * for Glob pattern, then select Create. (See below for more about scopes.)
-
Once the key is created, select Copy to retrieve the access key you need in the CLI:
-
Important: Save your key in a secure location because you cannot copy the key again later on. 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 via the CLI.
Scoping allows you to create separate API keys for different purposes. Each key has its expiration timeframe and can be scoped to specific packages (or glob patterns). Each key is also scoped to specific operations: push of new packages and updates, push of updates only, or delisting. Through scoping, you can create API keys for different people who manage packages for your organization such that they have only the permissions they need. For more information, see scoped API keys.
Publish with nuget push
-
At a command prompt, run the following command, replacing
<your_API_key>
with the key obtained from nuget.org:cli
-
nuget setApiKey <your_API_key>
This command stores your API key in your NuGet configuration so that you need repeat this step again on the same computer.
-
Push your package to NuGet Gallery using the following command:
cli
nuget push YourPackage.nupkg -Source https://api.nuget.org/v3/index.json
相关文章
- How to Enable Processor Resource Controls in Hyper-V
- SSIS How to Create an ETL Package Article 03/25/2022 3 minutes to read
- How to navigate back to the last cursor position in Visual Studio Code?
- How to use git commit template
- how to get a controller instance in another controller
- How to convert an IPv4 address into a integer in C#?
- java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start com
- c# 传递Null的string值导致的调用C++的dll报错 Attempted to read or write protected memory.
- 139Echarts - 树图(From Right to Left Tree)
- Failed to parse PID from file /run/nginx.pid: Invalid argument
- org.springframework.jdbc.CannotGetJdbcConnectionException Failed to obtain JDBC Connection
- How to install tensorflow on ubuntu 18.04 64bit
- Can't connect to MySQL server on localhost (10061)解决方法
- 从github clone文件: Failed to receive SOCKS4 connect request ack.
- How to export Excel files in a Python/Django application
- how to select checkbox on cli environment?
- There Are Now 3 Apache Spark APIs. Here’s How to Choose the Right One
- Can not evaluate the expression: Back-end (JVM) Internal error: Failed to generate expression: KtLam
- How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7
- resize2fs命令出现这个错误“resize2fs: Operation not permitted While trying to add group #6656” 有数据的会丢数据
- RUBY Error: Please update your PATH to include build tools or download the DevKit
- (Step by Step)How to setup IP Phone Server(VoIP Server) for free.
- [LeetCode] 857. Minimum Cost to Hire K Workers 雇佣K名工人的最低成本
- [LeetCode] 774. Minimize Max Distance to Gas Station 最小化去加油站的最大距离
- Ammbari2.6.5 安装NetUtil.py:97 - SSLError: Failed to connect. Please check openssl library versions
- [Errno 14] PYCURL ERROR 7 - “couldn‘t connect to host“