dotnet命令安装nuget包源

dotnet nuget add source http://192.168.3.222:8081/repository/nuget-hosted/ -n 192.168.3.222

因为是在用jenkins打包,且jenkins是单独的服务器,默认是没有配置自己搭建的nuget仓库地址的。所以需要在jenkins上手动配置自己的nuget仓库地址,才能restore自己的nuget包。执行以上命令即可。

dotnet nuget add source [仓库地址] -n [仓库名称]

具体参考官方文档:https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-nuget-add-source

移除包源命令:

dotnet nuget remove source 192.168.3.222

查看已安装的包源

dotnet nuget list source
原文地址:https://www.cnblogs.com/subendong/p/14798309.html