Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nuget for OS X
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
@dalini

This comment has been minimized.

Copy link

dalini commented Jun 24, 2013

FTW!

@Dexyon

This comment has been minimized.

Copy link

Dexyon commented Dec 4, 2013

Very nice. Thanks :)!

@keithics

This comment has been minimized.

Copy link

keithics commented Dec 28, 2013

dont forget to add proper permission

sudo chmod 755 /usr/local/bin/nuget

@arcaartem

This comment has been minimized.

Copy link

arcaartem commented Oct 9, 2014

Epic!

@danialfarid

This comment has been minimized.

Copy link

danialfarid commented Jun 18, 2015

When i call nuget pack I get this error:

$ NuGet Pack Package.nuspec
Attempting to build package from 'Package.nuspec'.
Cannot create a package that has no dependencies nor content.

Any solution?

Verbose log:

System.InvalidOperationException: Cannot create a package that has no dependencies nor content.
  at NuGet.PackageBuilder.Save (System.IO.Stream stream) [0x00000] in <filename unknown>:0 
  at NuGet.Commands.PackCommand.BuildPackage (NuGet.PackageBuilder builder, System.String outputPath) [0x00000] in <filename unknown>:0 

@graemechristie

This comment has been minimized.

Copy link

graemechristie commented Jul 27, 2015

@danialfarid - Typically that is due to an 'invalid' nuspec. In the case of nuget on OSX/linux, try using '/' on the path names rather than ''. Also, there is a bug on OSX where you need to specify the -BasePath argument to point the the path of the Nuspec file (It should default to this, but doesn't on OSX).

@acivang

This comment has been minimized.

Copy link

acivang commented Dec 6, 2016

great job,thx!

@zdobooto

This comment has been minimized.

Copy link

zdobooto commented Sep 1, 2017

On MacOS the command "dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 2.0.0"
gives the error for me "error: Unable to find package Npgsql.EntityFrameworkCore.PostgreSQL with version (>= 2.0.0)"

Could you please advise how to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.