NuGet Addin for MonoDevelop and Xamarin Studio 3.0 and 4.x
This is a port of the SharpDevelop NuGet package management addin that works with MonoDevelop and Xamarin Studio 3.0 and 4.x under Windows, Mac and Linux. It adds a Manage Packages dialog to MonoDevelop and Xamarin Studio where you can install, update or uninstall NuGet packages.
Please note that Xamarin Studio 5.0 and MonoDevelop 5.0 both have the NuGet addin built-in. All further development of the NuGet addin, for MonoDevelop and Xamarin Studio version 5.0 and above, will be done in the main MonoDevelop GitHub repository. The code available here is for MonoDevelop and Xamarin Studio 3.0 and 4.x.
The addin uses a custom build of NuGet.Core.dll, based on the original NuGet source code taken from CodePlex, some code from the latest version of the Mono runtime library and a custom build of Microsoft's XML Document Transformation (XDT) library.
For more information see the announcement blog post.
- MonoDevelop 3.0, 4.0, 4.2 or Xamarin Studio 4.0, 4.2
- Mono 2.10.9 or later
- mono-winfxcore (required by NuGet.Core)
- mono-wcf (required by NuGet.Core)
The addin is available from a custom MonoDevelop addin repository. You can add this repository to MonoDevelop or Xamarin Studio via the Add-in Manager. To open the Add-in Manager dialog on Windows and on Linux select Add-in Manager from the Tools menu. On the Mac open the Xamarin Studio menu and select Add-in Manager. In the Add-in Manager dialog select the Gallery tab. Click the down arrow next to the repositories drop down list and select Manage Repositories to open the Add-in Repository Management dialog. Click the Add button. Copy the MonoDevelop NuGet addin repository url, shown below, that corresponds to your MonoDevelop version, and paste it into the Url text box.
For MonoDevelop and Xamarin Studio 5.0:
The NuGet addin is built-in and does not need to be installed separately.
For MonoDevelop and Xamarin Studio 4.x:
For MonoDevelop 3.0:
Click the OK button and then click the Close button. Back in the Add-in Manager dialog expand IDE Extensions by clicking the arrow next to it. The addin should then be displayed under the IDE Extensions as NuGet Package Management. To install the addin select NuGet Package Management and then click the Install button.
Opening the Manage Packages Dialog
To open the Manage Packages dialog simply right click your project, or your solution or References in the Solutions window and select Manage NuGet Packages. You can also open the Manage Packages dialog by selecting Manage NuGet Packages from the Project menu.
Configuring NuGet Package Sources
The sources or feeds for NuGet packages can be configured in MonoDevelop's options.
On Linux open the options dialog by selecting Preferences from the Edit menu. On Windows select Options from the Tools menu. On a Mac select Preferences from the Xamarin Studio menu. In the Options dialog scroll down the categories on the left hand side until you find NuGet and then select Package Sources. Here you can add and remove NuGet package sources.
Original SharpDevelop addin code is LGPL.
- OpenSuse 12.2 - Mono 2.10.9
- Windows 7 - Mono 2.10.9
- OS X 10.8.2 - Mono 2.10.12
Addin fails to load with Type Load Exception
If the addin fails to load with a "type load exception has occurred" error message then check the required mono libraries are installed.
One way to check what assemblies are missing is to open NuGet.Core.dll in MonoDevelop's Assembly Browser and check the assemblies it references. The Assembly Browser should show the missing assemblies.
NuGet.Core.dll depends on
- System.Data.Services.Client v126.96.36.199
- WindowsBase v188.8.131.52
WindowsBase is in the mono-winfxcore package. Whilst System.Data.Services.Client is in the mono-wcf package.
If you see a WebException indicating there was an invalid certificate received from the server then you should try running the following:
mozroots --import --sync
See the original post on NuGet on Mono for more details.