筆記更新計劃,轉自: blog.zhuliang.ltd/back-end/ma…
製作、釋出所用工具:NuGetPackageExplorer
專案git地址: NuGetPackageExplorer git地址
uwp app:商店地址
本次演示所用版本為:UWP 5.0.9
製作包

- 在左側介面中新增包的一些基本資訊。
- 在右側介面中新增lib資料夾,在其中滑鼠右鍵可以自動生成一些特定.NET版本的資料夾,便於不同的.NET版本專案在安裝的時候可以根據設定的版本資料夾來進行安裝對應框架版本的dll。
- 建議將 dll 和 xml檔案全部放到 lib 資料夾內( 這樣子其他專案在安裝後不會在專案同級生成"註釋xml"檔案,但是註釋xml仍生效(xml和dll會直接生成在packages同一資料夾中了))
- 描述、說明寫在 description 欄位中。
釋出包:

- 釋出的時候,需要填寫下 nuget伺服器所在的地址以及設定的ApiKey。
- 注意:一個專案的一個版本號只能釋出一次,如果釋出多次會提示406錯誤。
- dll有更新,則在更改版本號後,重新進行publish。
新增其它包依賴

- 點選標識2按鈕的時候,不要指定“Target Framework”
- 在點選第3步按鈕出現的彈框中,選擇已經發布到伺服器上的包。(演示下使用包 TestModel),如下:

安裝含有依賴項的包
這裡直接新建一個測試專案安裝TestTool包(TestTool包依賴了TestModel包)
新建一個測試專案TestConsole,其初始引用如下:

安裝TestTool:

安裝完成後:提示資訊如下:

自動新增了依賴項TestModel:

釋出一個預覽版本的包
只要在版本號中包含-beta,-alpha,-rc即可,如:"2.0.0-alpha-01",

之後,在安裝的時候,需要勾選“包括預發行版”,才能顯示包含預釋出語義的版本,如下:

刪除已經發布的包
方法一:
- 直接到伺服器上刪除對應的資料夾
方法二:
刪除需要用到nuget.exe 下載:www.nuget.org/downloads commands doc:docs.microsoft.com/en-us/nuget…
定位到nuget.exe所在目錄,執行:
$nuget.exe delete <packageID> <packageVersion> [options]
如這裡刪除Test.Model 這個包的1.0.0版本,則為:
$./nuget.exe delete Test.Model 1.0.0 -Source http://192.168.1.120:4200/nuget -apikey 40bf22ac8e42
複製程式碼
