随笔 - 16,  文章 - 0,  评论 - 4,  阅读 - 9054

参考资料:

搭建私有的NuGet服务器

NuGet打包和发布

C++/C编程学习:使用nuget管理c++库的原理

Nuget服务的搭建-打包-上传-删除

一、服务器的建立

1.创建asp.net空的项目

2.添加NuGet.Server的nuget引用

3.编译并发布到IIS服务器.

4.参考资料4中列出了网页管理包的部分源码,试了下,由于不完整没弄成功.所以现在还是个最简单的nuget服务器

二、服务器的使用

1.发布nuget包:

  1.直接将nupkg包发布到服务器的packages文件夹下

  2.使用nuget命令发布

2.使用nuget服务

  在vc的nuget设置中添加服务地址即可

三.Nuget的使用

  1.生成nuspec文件

    建议用PackageExplorer工具,先生成后,再手动将路径修改成相对路径

   示例: 其中file中,src是源文件明的路径,target是nupkg打包文件中的路径,

metadata中的内容,根据需要修改
复制代码
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>sw.sqlite3.v143</id>
    <version>3.34.1</version>
    <title></title>
    <authors>bbb</authors>
    <owners>sw</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>My package description.</description>
  </metadata>
  <files>
    <file src="..\vcpkg\installed\x64-windows\include\*.h" target="build\native\include" />
    <file src="..\vcpkg\installed\x64-windows\debug\bin\*.dll" target="build\native\bin\x64\debug" />
    <file src="..\vcpkg\installed\x64-windows\debug\bin\*.pdb" target="build\native\bin\x64\debug" />
    <file src="..\vcpkg\installed\x64-windows\debug\lib\*.lib" target="build\native\lib\x64\debug" />
    <file src="..\vcpkg\installed\x64-windows\bin\*.dll" target="build\native\bin\x64\release" />
    <file src="..\vcpkg\installed\x64-windows\bin\*.pdb" target="build\native\bin\x64\release" />
    <file src="..\vcpkg\installed\x64-windows\lib\*.lib" target="build\native\lib\x64\release" />
    <file src=".\sw.nuget.v143.targets" target="build\native\sw.sqlite3.v143.targets" />
  </files>
</package>
复制代码

 

  2.打包

    nuget pack ***.nuspec

  3.发布

    nuget push mypkg.nupkg -source http://192.168.1.1/nuget -ApiKey ******

 

posted on   bdshr  阅读(197)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示