使用 BaGet 搭建 nuget 仓库

1、下载  BaGet ,地址:https://github.com/loic-sharma/BaGet/releases  项目地址:https://github.com/loic-sharma/BaGet/

2、解压,在 appsettings.json 文件中可配置密钥(见下面代码块,默认无),然后运行即可

"ApiKey": "NUGET-SERVER-API-KEY",

3、打包自己的类库,通过 visual studio ,在类库上按鼠标右键,选择打包即可

4、上传到 nuget 仓库

  (1)、windows键 + R,输入 cmd,回车,打开控制台; 

  (2)、控制台定位到包所在的目录;

  (3)、在控制台中输入:

dotnet nuget push -s http://ip:端口/v3/index.json -k 【配置的密钥】 【包文件名称.nupkg】

例如:
dotnet nuget push -s http://localhost:5000/v3/index.json -k NUGET-SERVER-API-KEY Test.Lib.1.0.2.nupkg

5、在 visual studio nuget 包管理器中添加程序包源(即搭建的nuget仓库的地址):http://localhost:5000/v3/index.json,然后就可以搜索安装刚刚上传的包了。

 

posted @ 2020-12-29 09:51  涓河樵  阅读(241)  评论(0编辑  收藏  举报