1:搭建服务器
安装iis -- 不在详述
使用vs新建web空网站-在nuget上安装nuget.serve.dll文件
打开web.config 找到 apikey标签 配置 上传密钥:123456(我的)
打包发布文件系统---> 部署到iis上。nuget服务器部署完毕。 (卧槽就是这么简单)浏览网站:
2:下载nuget命令行工具,打包类库项目上传到搭建好的nuget服务器。
下载地址:https://www.nuget.org/downloads
下载好配置 nuget.exe 环境变量--不赘述
然后到需要上传的类库目录下面打开命令行
nuget spec Myproject.csproj 生成 .nuspec文件--修改该文件
<?xml version="1.0"?>
<package >
<metadata>
<id>Dclass</id> --这是id就是打算安装nuget包的时候的搜索里面写的东东
<version>6.7.1.0</version> --版本号不用多说了
<title>dclass</title> --标题什么的随便写写就好啦
<authors>chenchang</authors> ---这是作者啦
<owners>chenchang</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl> 这一波东东一般用不到,想研究的话去nuget官网看下吧https://docs.microsoft.com/en-us/nuget/what-is-nuget
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>target framework</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2019</copyright>
<tags>3.3.4 4.5</tags>
</metadata>
</package>
生成nuget包: 这里需要注意下 看你需求打包的版本是release还是debug版本
nuget pack my.csproj --debug版本
nuget pack my.csproj -Properties Configuration=Release --release版本
打包成功 -- 上传nuget包
nuget push mypackage.nupkg -Source http://10.0.2.15:9588/nuget -apikey 123456
感觉不顺眼可以 删除已经上传的nuget包--删除nuget包的时候注意添加版本号,本来感觉不添加版本号会全部删除,但是测试失败啦,所以删除的时候貌似只能一个一个删除,当然你也可以直接去
nuget服务器全部清除 , 或者直接到指定的package目录下面手动删除哈~
nuget delete mypackage 1.0.0 -Source http://10.0.2.15:9588/nuget -apikey 123456