使用BaGet搭建自己的Nuget服务器
一、下载部署BaGet BaGet下载地址:https://github.com/loic-sharma/BaGet 可以自己编译,也可以下载作者提供的Release版本 二、下载安装Nuget Nuget.exe 下载地址:https://dist.nuget.org/win-x86-commandline/latest/nuget.exe Nuget安装后还需要配置环境变量 三、打包Nuget 在项目.csproj目录中打开cmd 或者powershell 并执行:nuget spec 用文本编辑器将上述命令执行完成的.nuspec 文件进行编辑 <?xml version="1.0"?> <package > <metadata> <id>Dongteng</id> <version>1.0.0</version> <title>ceshiceshi</title> <authors>Dongteng</authors> <owners>$author$</owners> <licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl> <projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl> <iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>dongteng test</description> <releaseNotes>Summary of changes made in this release of the package.</releaseNotes> <copyright>Copyright 2019</copyright> <tags>Tag1 Tag2</tags> </metadata> </package> 根据实际的需求修改,一般修改id、version、authors、`description等 修改完以上信息后执行命令:nuget pack,进行打包.正常结果如下 也可以使用bat脚本执行 nuget-publish.cmd : @echo off echo *******************clean nupkg******************* del /S *.nupkg del /S *.nuspec echo *******************building******************* dotnet build echo *******************pack nupkg******************* dotnet pack echo *******************publish nupkg******************* dotnet nuget push **/*.