天天看点

vs环境基于github的nuget包管理

  1. 申请github用户的key,需要库包写入和读取权限
  2. 打开vs环境的终端窗口,添加nuget的源
    dotnet nuget add source -name "github" -source "https://nuget.pkg.github.com/GitHub用户名/index.json" -u GitHub用户名 -p GitHub的key
               
  3. 编译生成包
  4. 在终端窗口输入命令,发布
    dotnet nuget push "发布包文件的路径" --source "github"
               

      GitHub用户手册文章:

https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-dotnet-cli-for-use-with-github-packages

备注:项目属性中项目URL和存储库URL需要填写