Tag: C#

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