Skip to content

Latest commit

 

History

History
35 lines (33 loc) · 1.04 KB

nuget.md

File metadata and controls

35 lines (33 loc) · 1.04 KB
  • Sample Nuget.Config for public Nuget
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>
  • Sample Nuget.Config for private Nuget
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="lib" value="https://pkgs.dev.azure.com/khoitmp/Sandbox/_packaging/lib/nuget/v3/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <lib>
      <!-- Create PAT -->
      <add key="Username" value="azuredevops" />
      <add key="ClearTextPassword" value="<token>" />
    </lib>
  </packageSourceCredentials>
</configuration>
  • Pack & Push
dotnet build
dotnet pack
dotnet nuget push --source <source_name> --api-key <key> <path>/<file_name>.nupkg # Public
dotnet nuget push --source <source_name> --api-key az <path>/<file_name>.nupkg # Private