只有累積,沒有奇蹟

2019年2月8日 星期五

[Nuget] The term 'nuget.exe' is not recognized as the name of a cmdlet, function, script file, or operable program

問題 
接開發完 Libary 專案要上傳到 nuget server 時,要將 package 檔案透過指令 push 噴 error 錯誤訊息 nuget.exe : The term 'nuget.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the n ame, or if a path was included, verify that the path is correct and try again. ,此篇簡單紀錄遇到這問題時該如何解決。

如何解決
Nuget 官網下載網頁可以得知,在 Visual Studio 任何版本並不包含 nuget.exe,如果有需要上傳 package 檔案需要另外安裝 NuGet command line tool,目前 nuget.exe 推薦的版本為 v4.9.2

可以透過下列兩種方式安裝 nuget command line tool
Package Manage Console
Tools > Nuget Package Manager > Package Manage Console 輸入以下指令安裝
  1. Install-Package NuGet.CommandLine
Manage Nuget Package
Tools > Manage Nuget Package > 輸入 NuGet.CommandLine > Install

Retry
安裝完畢之後,我們重新 push 一次
  1. nuget.exe push {package file} {apikey} -Source http://localhost/nuget
如上圖所示即可透過 command line 上傳成功
Happy new year :)

參考
nuget



Related Posts:

  • [Nuget] 架設公司內部 Nuget Server 前言  在開發上常常會遇到某些代碼是跨專案共用的,在 .NET 中會將重複使用的代碼打包成「套件」,其中包含了編譯後的 dll 以及相關的檔案資訊,接著將套件內容上傳到 Nuget Server 上提供開發者下載使用,Nuget server 有分共用與私人主機兩種,共用的 nuget server 上有相當多好用的 libary 供開發者下載,例如常用的 NLog、newtonsoft.json、NUnit...等各種好用的 pack… Read More
  • [VisualStudio].NET 程式碼品質分析利器 SonarLint前言  前陣子部門導入 SonarQube 來分析程式碼品質的工具,會定期掃描當前 GIT 上前後端程式碼分析其代碼質量、Code Smell、找到可能潛在的問題、安全漏洞、單元測試涵蓋率,並可透過視覺化 Dashboard 介面查看目前分析代碼的狀態,且支援分析 25 種以上程式語言,可以說是整合性相當高的程式碼分析工具。今天與同事討論提到 SonarQube 有出擴充工具 SonarLint 與&nbs… Read More
  • [Nuget] 使用 NuGet Package Explorer 製作 Nuget 套件問題  在上一篇介紹了如何架設公司內部 nuger server,架設完畢後會使用 nuget push 指令將開發完 Library 上傳到公司內部 nuget server 上,但每次都要透過手動打指令 push 難道沒有更快的方法了嗎 ? 今天就要來介紹一套好用的工具 Nuget Package Explorer 可以省去打指令的動作,透過 GUI 的介面將開發好的 Library 上傳到共用或是私人架設的 nuget … Read More
  • [Redis] C# 存取 Redis - 使用 StackExchange.Redis前言  前面幾篇在介紹 Redis 的安裝以及使用 Redis Desktop Manager 工具,現在終於回到主題如何用 C# 存取 Redis 服務,在官方網站推薦的 .NET Redis client(s) 有很多種,討論度最高的為 StackExchange.Redis 其開發者在 StackExchange 公司工作且 Library 廣為 .NET 開發者推薦,這篇文章要介紹&nbs… Read More
  • [Nuget] The term 'nuget.exe' is not recognized as the name of a cmdlet, function, script file, or operable program問題  最接開發完 Libary 專案要上傳到 nuget server 時,要將 package 檔案透過指令 push 噴 error 錯誤訊息 nuget.exe : The term 'nuget.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the … Read More

0 意見:

張貼留言

Copyright © 2025 m@rcus 學習筆記 | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com