'nuget' is not recognized but other nuget commands working

前端 未结 9 1438
走了就别回头了
走了就别回头了 2020-12-02 10:41

I am trying to create a nuget package using http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory as a ref

9条回答
  •  一整个雨季
    2020-12-02 11:16

    Nuget.exe is placed at .nuget folder of your project. It can't be executed directly in Package Manager Console, but is executed by Powershell commands because these commands build custom path for themselves.

    My steps to solve are:

    • Download NuGet.exe from https://github.com/NuGet/NuGet.Client/releases (give preference for the latest release);
    • Place NuGet.exe in C:\Program Files\NuGet\Visual Studio 2012 (or your VS version);
    • Add C:\Program Files\NuGet\Visual Studio 2012 (or your VS version) in PATH environment variable (see http://www.itechtalk.com/thread3595.html as a How-to) (instructions here).
    • Close and open Visual Studio.

    Update

    NuGet can be easily installed in your project using the following command:

    Install-Package NuGet.CommandLine

提交回复
热议问题