Skip to content

Donwload NuGet Packages On Mac

Stanislav Osipov edited this page Feb 1, 2022 · 1 revision

Install Nuget CLI

First of all, make sure you gave your NuGet client installed on Mac

  • brew install mono

Alternatively, you can download Mono for Mac. This is an installer if that makes you happy.

Updating Nuget CLI

Windows: Open a command prompt and enter this command (assuming the path to nuget.exe is in your PATH):

  • nuget update -self

Mac OsX Assuming you used homebrew to install mono, you should be able to run the same update command as Windows (as it is the same Nuget.exe). However, I found the install location for my nuget shell script (see point 2.2. in the Getting Nuget CLI section above) was only editable by root. Hence, I had to do this:

  • sudo nuget update -self

Side Note: For a reason, I can't yet figure out, when I updated mono using brew (brew update && brew upgrade mono), the Current symbolic link did not get updated. I had to do this manually:

  • sudo ln -sfn /Library/Frameworks/Mono.framework/Versions/5.14.0 Current

Download Nuget Package

Now in order to download any NuGet package you can use the following command:

  • nuget install <package_name>

For example:

  • nuget install moq
  • nuget install System.Memory