zoukankan      html  css  js  c++  java
  • 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

    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:

      Copying the API key to the clipboard

    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
    • 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
  • 相关阅读:
    第二阶段Sprint冲刺会议8
    第二阶段Sprint冲刺会议7
    第二阶段Sprint冲刺会议6
    问题账户需求分析
    2016年秋季个人阅读计划
    应该怎么做需求分析--读后感
    个人总结
    人月神话第三篇阅读笔记
    第十六周学习进度
    人月神话第二篇阅读笔记
  • 原文地址:https://www.cnblogs.com/chucklu/p/11445857.html
Copyright © 2011-2022 走看看