mardi 29 mai 2012

Using NuGet with mono on Debian

I tried to use NuGet on my Debian installation and I had several issues to solve. Thanks to this and this link, I was finally able to make it work! Here are the steps:

First install mono with all the SDK:
$ sudo apt-get install mono-complete
Install https certificate so that Mono can trust the source for NuGet
$ mozroots --import --sync

Download NuGet command line bootstrapper (NuGet.exe)

Copy MsBuild dll from Microsoft and put it in the same directory as NuGet.exe. You can find this dll in a Windows OS here "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.dll" or you can find it in Windows SDK for .NET framework 4.0

Finally, running this command line should show help information
$ mono --runtime=v4.0.30319 NuGet.exe
And you should be able to download any package with
$ mono --runtime=v4.0.30319 NuGet.exe Install Cassette.Web