NuGet Package Registry
To work with NuGet packages, the official utility is required.
Windows
Installing NuGet via Chocolatey
- Run the following command in an administrative command prompt:
choco install nuget.commandline
- Wait for the installation to complete.
Verifying Installation
- In the command prompt, execute:
nuget
- If NuGet is installed correctly, you will see help information about NuGet commands.
macOS
Installing NuGet via Homebrew
-
Run the following command in the terminal:
brew install nuget
-
Verifying installation:
nuget
- If NuGet is installed correctly, you will see help information about NuGet commands.
Linux
Installing NuGet via .NET SDK
- 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
-
Update the package list and install the .NET SDK:
sudo apt-get update sudo apt-get install -y dotnet-sdk-6.0
-
Verifying installation:
dotnet --version
- If the .NET SDK is installed correctly, you will see the version number. NuGet should be available via the
dotnet
command:
dotnet nuget
Installing NuGet via Mono
- Run the following command in the terminal:
sudo apt install mono-complete
- Download the executable to the project directory:
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- Verifying installation:
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.