Xamarin Studio 5.0 now hasNuGet support built in. There are also some experimental NuGet features that are available for Xamarin Studio 5.0 and MonoDevelop 5.0 as part of a separateNuGet extensions addin. One such experimental feature is a new PowerShell console window that provides Xamarin Studio with the standard NuGet commands and also works on the Mac, not just Windows.
The new console window is powered by Pash. Pash is a open source reimplementation of PowerShell that works with Mono and runs on Windows, Mac and Linux. It was created byIgor Moochnick and more recently development has been restarted byJay Bazuzi.
The NuGet extensions addin is available from theMonoDevelop addin repository. To install the addin:
Please close and re-open Xamarin Studio before trying to open the PowerShell Console window otherwise Xamarin Studio will crash.
To open the console window, from theView menu selectPads and then selectPackage Console Extension.
The top of the console window has drop downs allowing you to choose a different default package source or default project. At the top right there is a Clear Console button which will clear all the text from the console.
The standardNuGet PowerShell commands are available from the console window:
There is also a partial implementation of theVisual Studio object model (EnvDTE) which you can use from the console and from PowerShell scripts inside a NuGet package. Currently the Solution object and the CodeModel is not fully implemented when compared with SharpDevelop.
When you install a NuGet package from the console and the NuGet package has aninit.ps1 or aninstall.ps1 PowerShell script then these scripts will be run. Similarly on uninstalling a NuGet package if it contains anuninstall.ps1 script then this will be run in the console. However there are some areas of PowerShell that are not fully implemented in Pash so the script may well fail. The failure will be logged in the console window but it will not prevent the package from being installed or uninstalled.
That concludes the introduction to the experimental NuGet Package Console in Xamarin Studio.