Creating a NuGet from Existing Library Projects

PDF for offline use
Related Links:

Let us know how you feel about this


last updated: 2017-02

Existing PCL or .NET Standard libraries can be turned into NuGets via the Project Options window:

  1. Right-click on the library project in the Solution Pad and choose Options.

  2. Go to the NuGet Package > Build section and tick Create a NuGet Package when building the project:

    Tick to create a NuGet package

  3. Go to the NuGet Package > Metadata section and enter all the required information in the General tab:

    Enter required metadata

  4. Optionally, add additional metadata in the Details tab.

  5. Right-click on the project and choose Create NuGet Package (or build or deploy the solution) and the .nupkg NuGet package file will be saved in the /bin/ folder (either Debug or Release, depending on configuration).

    Choose Create NuGet Package from the right-click menu

Verifying the Output

NuGet packages are also ZIP files, so it's possible to inspect the internal structure of the generated package.

This screenshot shows the contents of a PCL-based NuGet – only a single PCL assembly is included:

Files contained in the NuGet package

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.