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

  1. 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.

  2. Select your user name (on the upper right), then select API Keys.

  3. 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.)

  4. Once the key is created, select Copy to retrieve the access key you need in the CLI:

  5. 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

  1. At a command prompt, run the following command, replacing <your_API_key> with the key obtained from nuget.org:

    cli
    1. 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
  1. nuget push YourPackage.nupkg -Source https://api.nuget.org/v3/index.json

How to Publish a NuGet Package的更多相关文章

  1. Creating a NuGet Package in 7 easy steps - Plus using NuGet to integrate ASP.NET MVC 3 into existing Web Forms applications

    UPDATE: Check out my follow up post where I remove the need for editing the Global.asax.cs and show ...

  2. 用 NuGet Package Explorer 管理你的攻城武器

    缘由:每次新建一个工程,总是要从自己的“弹药库”或者之前的工程里面手动引用一些类库和脚本插件,难免有些繁琐和遗漏.想起经常用到的NuGet,跑到NuGet主页一看,发现有 NuGet Package ...

  3. 搭建本地Nuget服务器并使用NuGet Package Explorer工具打包nuget包

    1.什么是Nuget: 百度百科描述: Nuget是 ASP .NET Gallery 的一员.NuGet 是免费.开源的包管理开发工具,专注于在 .NET 应用开发过程中,简单地合并第三方的组件库. ...

  4. Updating and Publishing a NuGet Package - Plus making NuGet packages smarter and avoiding source edits with WebActivator

    I wrote a post a few days ago called "Creating a NuGet Package in 7 easy steps - Plus using NuG ...

  5. 使用 dotnet CLI 来打包和发布 .NET Core nuget package

    原文链接:使用 dotnet CLI 来打包和发布 .NET Core nuget package 如何使用 visual studio 2015/2017 打包和发布 Nuget package, ...

  6. [转]Bootstrap 3.0.0 with ASP.NET Web Forms – Step by Step – Without NuGet Package

    本文转自:http://www.mytecbits.com/microsoft/dot-net/bootstrap-3-0-0-with-asp-net-web-forms In my earlier ...

  7. 使用NuGet Package Project快速制作NuGet包

    今天在visual studio gallery发现了一个插件NuGet Package Project,通过它可以在Visual Studio中建立Nuget Package工程,直接生成Nuget ...

  8. Visual Studio 2010 更新NuGet Package Manager出错解决办法

    在Visual Studio 2010的扩展管理器中发现NuGet Package Manger有最新版本更新提示,选择更新安装提示以下错误信息: 2013/4/25 1:11:48 - Micros ...

  9. Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. T

    错误提示: Severity Code Description Project File Line Suppression StateError This project references NuG ...

随机推荐

  1. 将两个数组相同index的value合并成一个新的value组成一个新的数组

    将两个数组相同index的value合并成一个新的value组成一个新的数组 前提: 这两个数组的长度相同 生成后的新数组长度也相同 返回值都是对象 把rows对象的key和value弄成两个数组, ...

  2. linux shell数值比较和字符串比较

    说明: 1. 把字符串当成整型进行比较,由于abcd等字符对不上0123当程序尝试去转成二进制时无法完成转换,所以用于数值比较的运算不能用于字符串比较:但是把整型当成字符串进行比较,0123这些数值完 ...

  3. MySQL之日期时间函数

      1.NOW() 用法:显示当前日期和时间 举例: mysql> select NOW(); +---------------------+ | NOW() | +-------------- ...

  4. 十年阿里顶级架构师教你怎么使用Java来搭建微服务

    微服务背后的大理念是将大型.复杂且历时长久的应用在架构上设计为内聚的服务,这些服务能够随着时间的流逝而演化.本文主要介绍了利用 Java 生态系统构建微服务的多种方法,并分析了每种方法的利弊. 快速预 ...

  5. Centos超详细安装步骤

    Linux中三大主流操作系统 Ubuntu 优点:用户界面友好.工具完善 缺点:vps(虚拟服务器)成本较高.不具备商业化服务器操作系统 Centos--目前常用centos6.x,centos7.x ...

  6. Java学习第一天之简单了解java语言及开发环境的安装

    一.初步了解Java语言 Java语言是由Sun公司的James Gosling创造的一门面向对象的高级语言. 2009年4月20日,Sun公司被Oracle以总价值约为74亿美元的价格收购,Java ...

  7. 2.Storm集群部署及单词统计案例

    1.集群部署的基本流程 2.集群部署的基础环境准备 3.Storm集群部署 4.Storm集群的进程及日志熟悉 5.Storm集群的常用操作命令 6.Storm源码下载及目录熟悉 7.Storm 单词 ...

  8. python基础应用---列表应用

    列表:列表用[]来表示 names = ['wang', 'yuan', 'yang', 'china', 'french', 'wang'] #列表增加 names.append('zhang') ...

  9. Python自动化测试PO模式

    页面元素定位信息 页面元素定位信息文件 [leadscloud_login] input_user_name = xpath>//*[@id='main']/div/div[2]/div[2]/ ...

  10. Selenium(十一)使用EXCEL读取用户数据和生成测试报表

    1.下载两个模块 2.xlrd的使用方法 3.使用excel获取数据 在userdata文件中增加代码: login.py: 4.使用excel生成测试报表 举例: 在log_module中定义函数: ...