Friday, November 22, 2013

Testing Nuget package

In our previous article we described how to create Nuget package using Nuget Package Manager tool.
Now we are going to discuss how to test this new package locally (without uploading it on service).
To test new package locally you should tell Visual Studio where to search for your package.

1. Run Visual Studio and open some project (it can be an empty one).

2. Open Package Manager Console and click on Options button

3. In the Options dialog:

  • Click on "Plus" button
  • Specify source name (e.g. "Local Package source") and the path to the folder where with new package.
  • Click OK to close the dialog.

4. Select "All" or "Local Package source" in the "Package source" combo-box

5. Now you can install your package:
Install-Package MyPackage 
When you modify your NuGet package - change its version number before saving. In this case you will be able to apply the latest changes using the same 
Install-Package command without uninstalling the package first.