Saturday, May 14, 2011

Using NuGet to package ArcGIS WPF references.

Tested to use NuGet to create a package of the ArcGIS WPF APIs. Installed NuGet Package manager using extension manager in VS2010.

Installed the NuGet Package Explorer and created a package called ArcGIS.Client.WPF and added content, lib, framework and DLLs in the correct framework. Saved the package to a *.nupkg fil in a local folder C:\NUGet\Packages

To get make the package available to NuGet I added the folder in VS2010, Tools | Library Package Manager | Package Manager Settings

Now it's possible to use the package from a project, after starting a WpfProject in VS2010 I start up the consol by choosing, Tools | Library Package Manager | Library Package Console

when the console window opened up it's possible to choose the local folder that we added to the settings

Now it's time to install the package in the project, this is easy, only need to write install-package ArcGIS.Client.WPF and the package gets installed:

References to the package gets added to the project:

If we take look in explorer where the package ended up the filsystem looks like this:

So what's does all this mean, well you can create you own packages that can be easily be added in your projects. This makes it easier to handle dependencies and upgrades. There is a lot of packages on the NuGet Gallery but if you are missing a package or have internal DLL NuGet makes it easy to handle all external dependencies in your projects.

No comments: