Publishing a Nuget package to an internal server

Make sure you have Nuget installed. If you don’t have it, you can download it from https://www.nuget.org/downloads.

Commands

Create package: nuget.exe pack [path to csproj file]

Publish package: nuget.exe push [path to nupkg file] -source [nuget server uri] -ApiKey [key]

Example of nuspec file:

<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <id>$id$</id>
    <version>$version$</version>
    <authors>[name]</authors>
    <owners>[company]</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>
        [description of your library]
    </description>
    <releaseNotes></releaseNotes>
    <tags>[tag1] [tag2]</tags>
  </metadata>
</package>

Replace [name], [company], [description of your library] and tags accordingly.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s