SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Matt Ward

NuGet Support in SharpDevelop

SharpDevelop 4.1 now includes support for NuGet. You can now add references to NuGet packages to your projects from SharpDevelop.

Adding NuGet Packages

To add a NuGet package reference select your project in the Projects window, right click and select Add Package Reference.

Add Package Reference menu item

The Add Package Reference dialog will then be displayed.

Add Package Reference dialog

The dialog has four tabs at the top. The Installed tab shows all packages that have been installed for the current project. The Available tab shows all the packages available from the NuGet package repository. The Updates tab shows the packages that have newer versions available. The Recent tab shows packages that were recently installed.

Select the Available tab to show the packages that can be installed. Information on a package will be displayed on the right hand side when the package is selected.

To find a package you can either page through the packages by clicking the arrows and page numbers underneath or you can search for a package by name. To search for a package enter the name in the search text box at the top right and press return or click the search icon. The matching packages will then be displayed. To clear the search results remove the search text and run the search again.

Searching for package references

To install a package, select it and click the Add button. If the package requires you to accept a license agreement a dialog will be displayed allowing you to accept or decline the agreement.

Package license agreement window

After that the package and any dependencies will be installed. Your project will be updated to include new assembly references and source code files from the package. The installed package will now have green tick icon next to it showing that is has been installed.

NuGet package installed

Click the Close button to close the Add Package Reference dialog.

Removing NuGet Packages

To remove a NuGet package open the Add Package Reference dialog and select the Installed tab.

Installed packages in the Add Package Reference dialog

Select the package you want to remove and click the Remove button. The package will then be removed and your project will be updated.

Updating NuGet Packages

To update a NuGet package open the Add Package Reference dialog and select the Updates tab.

Package updates in the Add Package Reference dialog

Select the package you want to update and click the Add button. The package and its dependencies will then be updated.

Configuring NuGet

By default the official NuGet repository will be used when searching for available packages. If you want to set up a different NuGet repository, such as one on your local file system, then select Options from the Tools menu. In the Options dialog select Package Management and then Package Sources.

Packagement repository configuration

Here you can add and remove NuGet repositories as required.

Under the General options you can clear the recent packages and the local package repository cache.

General Package Management options

PowerShell Console

SharpDevelop has a PowerShell console that can be used to install NuGet packages with PowerShell scripts.

PowerShell console window

Further information on the PowerShell console can be found in the NuGet PowerShell Console post.

Published Jan 23 2011, 02:27 PM by MattWard
Filed under:

Comments

 

graveen said:

Wow. This project is awesome, and having SD supporting it is really excellent.

January 26, 2011 9:04 PM
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.