小匕首-dotnet cli使用nuget指令

简介: 小匕首-dotnet cli使用nuget指令

一、指令清单

输入指令dotnet nuget -h

>dotnet nuget -h
NuGet Command Line 6.0.0.129
Usage: dotnet nuget [options] [command]
Options:
  -h|--help  Show help information
  --version  Show version information
Commands:
  add      添加 NuGet 源。
  delete   从服务器删除一个包。
  disable  禁用 NuGet 源。
  enable   启用 NuGet 源。
  list     列出配置的 NuGet 源。
  locals   清除或列出本地 NuGet 资源,例如 http 请求缓存、包文件夹、插件操作缓存或计算机范围全局包文件夹。
  push     将包推送到服务器并发布。
  remove   移除 NuGet 源。
  sign     使用指定的证书对 <package-paths> 处的 NuGet 包进行签名。
  trust    管理受信任的签名人。
  update   更新 NuGet 源。
  verify   验证已签名的 NuGet 包。
Use "dotnet nuget [command] --help" for more information about a command.

二、获取配置源

列出配置的 NuGet源:

>dotnet nuget list -h
Usage: dotnet nuget list [options] [command]
Options:
  -h|--help  Show help information
Commands:
  client-cert  列出配置中的所有客户端证书。
  source       列出所有配置的 NuGet 源。

查看本地数据源source

>dotnet nuget list source
注册的源:
  1.  nuget.org [已启用]
      https://api.nuget.org/v3/index.json
  2.  Osharp [已禁用]
      D:\Program Files\Nuget\Osharp\nupkgs
  3.  Microsoft Visual Studio Offline Packages [已禁用]
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

三、启用/禁用配置源

禁用配置源

>dotnet nuget disable -h
Usage: dotnet nuget disable [options] [command]
Options:
  -h|--help  Show help information
Commands:
  source  禁用 NuGet 源。
Use "disable [command] --help" for more information about a command.

启用配置源

>dotnet nuget enable -h
Usage: dotnet nuget enable [options] [command]
Options:
  -h|--help  Show help information
Commands:
  source  启用 NuGet 源。
Use "enable [command] --help" for more information about a command.

启用/停用目标源

>dotnet nuget disable source  -h
Usage: dotnet nuget disable source [arguments] [options]
Arguments:
  name  源的名称。
Options:
  --configfile  NuGet 配置文件。如果指定,将仅使用此文件中的设置。如果未指定,则将使用当前目录中的配置文件的层次结构。有关详细信息,请参阅 https://docs.microsoft.com/nuget/consume-packages/configuring-nuget-behavior。
  -h|--help     Show help information
>dotnet nuget enable source  -h
Usage: dotnet nuget enable source [arguments] [options]
Arguments:
  name  源的名称。
Options:
  --configfile  NuGet 配置文件。如果指定,将仅使用此文件中的设置。如果未指定,则将使用当前目录中的配置文件的层次结构。有关详细信息,请参阅 https://docs.microsoft.com/nuget/consume-packages/configuring-nuget-behavior。
  -h|--help     Show help information

操作案例

>dotnet nuget disable source  nexus-server
已成功禁用名称为 nexus-server 的包源。

相关文章
|
6月前
|
Go Windows
5个步骤搞定protoc环境安装
5个步骤搞定protoc环境安装
225 1
|
9月前
小匕首-dotnet cli使用tool指令
小匕首-dotnet cli使用tool指令
72 0
|
Unix Linux Shell
怎么样在Windows下使用Make编译Golang程序
怎么样在Windows下使用Make编译Golang程序
1146 0
发布一个npm包和命令行脚本
发布一个npm包和命令行脚本
127 0
|
资源调度 JavaScript iOS开发
NPM 7 workspace模式安装依赖执行找不到sentry-cli
搜遍了谷歌还有相关Github Repo Issues都没有, npm workspace的资料都不多, 有个别都是yarn workspace说什么安装依赖异常, 换成国内的淘宝源啊,来来去去都说什么源找不到, 一顿操作猛如虎,问题还是没有解决。 只能自己摸索了,我的解决姿势感觉应该是全网第一例!
543 0
|
API 开发工具
使用dotnet Cli向nuget发布包
长话短说, 今天分享如何在nuget.org创建并发布.NET Standard package。
使用dotnet Cli向nuget发布包
NuGET 命令
一、安装 1.安装指定版本类库 Install-Package  -version  2.安装到指定的项目 Install-Package  -project XXXProjectName -version  二、更新 Update-Package  三、重新安装 1.
1269 0
|
存储 jenkins 持续交付