私有Nuget 服务器搭建 以及 更新 nupkg
·
1. 环境准备
1.1 .NET Framework 4.8
1.2 IIS
2.搭建私有Nuget Server
2.1 下载发布包
下载:https://download.csdn.net/download/CsethCRM/89689321
下载后解压如图:

2.2 运行 AutoDeployNuGetServerWebSite.bat 部署Nuget Server Web 站点

2.3 查看bat自动部署好的Web站点

2.4 打开 http://127.0.0.1:9999/ 查看

2.5 Nuget Server Success.
3.私有Nuget包源
http://机器IP:9999/nuget
在 VS中,设置自己私有的Nuget包源:
工具 -> Nuget包管理器 -> 程序包管理器设置 -> 程序包源
4. 推送上传自定义的Nuget包
4.1 手动方式 - 上传到Packages文件夹即可
手动/配置个ftp:适合权限比较大的 运维人员/管理员

4.2 命令行方式
命令行:适合团队成员日常 更新包 的场景
4.2.1 在web.config 拿到 apikey

4.2.2 执行Nuget push 命令
命令语法:dotnet nuget push {nupkg包路径} -k {apikey} -s {url}
dotnet nuget push C:\workspace\IX.RCL.Front.2023.1.0.nupkg -k MyNugetServerKey -s http://127.0.0.1:9999/

附录:
问题1:
PUT http://127.0.0.1:9999/api/v2/package/
MethodNotAllowed http://127.0.0.1:9999/api/v2/package/ 963 毫秒
error: Response status code does not indicate success: 405 (Method Not Allowed).
解决:
卸载 WebDev

更多推荐

所有评论(0)