Using NuGet with Mono

Found myself wanting to use NuGet under Mono today and thought I'd share;

  • Download the NuGet BootStrapper from nuget.codeplex.com/releases
  • Tell Mono certs to trust when doing https: mozroots --import --sync
  • Use an environment variable to enable package restore (suggest shell startup): export EnableNuGetPackageRestore=true
  • Install NuGet (via BootStrapped) into location (~/.local/shared/NuGet):
    mono NuGet.exe
  • Create a nice bash script to run from console:
#!/bin/sh
exec mono --runtime=v4.0.30319 --gc=sgen "/users/ian/.local/share/NuGet/NuGet.exe" "$@"

BISH BASH BOSH!