Skip to content

NuGet Package Registry


Installing NuGet

An official utility is required to work with NuGet packages. Install it according to the instructions for the required OS:

  1. In the command prompt with administrator rights, run the command:

    choco install nuget.commandline
    
  2. Wait for the installation to complete.

  3. Check the installation. In the command prompt, run the command:

    nuget
    

If NuGet is installed correctly, you will see background information about NuGet commands.

  1. Run the command in the terminal:

    brew install nuget
    
  2. Wait for the installation to complete.

  3. Check the installation. In the command prompt, run the command:

    nuget
    

If NuGet is installed correctly, you will see background information about NuGet commands.

  1. Open the terminal and add the Microsoft key:

    wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    sudo dpkg -i packages-microsoft-prod.deb
    
  2. Update the package list and install .NET SDK:

    sudo apt-get update
    sudo apt-get install -y dotnet-sdk-6.0
    
  3. Check the installation. In the command prompt, run the command:

    dotnet --version
    
  4. If .The NET SDK is installed correctly, you will see the version number. NuGet should be accessible via the `dotnet' command:

    dotnet nuget
    
  1. In the terminal, run the command:

    sudo apt install mono-complete 
    
  2. Upload the executable file to the project directory:

    wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe 
    
  3. Check the installation. In the command prompt, run the command:

    mono nuget.exe
    

Registering the GitFlic Registry

To add NuGet packages, you need to obtain a GitFlic transport token. For instructions on obtaining the token, refer to this page.

In the documentation below, you may encounter the attribute <gitflic_domain>. Replace it with the appropriate domain, depending on the version:

  • For SaaS version: registry.gitflic.ru

  • For self-hosted: localhost:8080

The domain and port for the self-hosted version may differ.

The value of the url attribute depends on the access level:

Level URL
Project http(s)://<gitflic_domain>/project/{ownerAlias}/{projectAlias}/package/-/nuget/index.json
Company http(s)://<gitflic_domain>/company/{companyAlias}/package/-/nuget/index.json
Instance http(s)://<gitflic_domain>/registry/package/-/nuget/index.json
URL Variable Description
ownerAlias Project owner's alias
projectAlias Project alias
companyAlias Company alias

To register the registry, run the following command:

nuget source Add -Name GitFlic -Source "{registry_url}" -UserName {username} -Password {transport_token}  

Example:

nuget source Add -Name GitFlic -Source "http://localhost:8080/project/adminuser/test/package/-/nuget/index.json" -UserName adminuser -Password 802b148c-aaaa-aaaa-aaaa-036712b0d269  

Downloading and Installing a Package

To install a package, run the following command:

nuget install package_name -Source GitFlic  

Publishing a Package

To publish a package, run the following command:

nuget push package_name.nupkg -Source GitFlic  

Automatic translation!

This page has been automatically translated. The text may contain inaccuracies.