How to host your own nuget v3?

My organization has several nuget v2 channels (a .net application using nuget.server) for our internally developed packages and for re-hosting third-party packages (since our build machines do not have Internet access, and we check which package developers consume in our product and would like the builds to fail if we don’t have the package).

Whenever I add any packages that require nuget client 3.0+ for my nuget servers, the nuget server crashes because it cannot read metadata from these packages. How can I host my own nuget v3 server / upgrade existing nuget servers for v3 compatibility?

+6
source share
3 answers

Recently, I wrote the nuget server assembler internetworking.

Of course, the implementation is so stupid, ugly, etc .... link

You can configure it in Startup.cs

public void ConfigureServices( IServiceCollection services ) { ... services.AddNugetServer(opt=> { opt.ApiKey = "This is a string used for adds or deletes your package(s)"; opt.PackageDirectory = "/path/to/your/packages"; //default is current path + "/packages" }); ... } public void Configure( IApplicationBuilder app, IHostingEnvironment env ) { ... app.UseNugetServer(); } 

And visit http (s): // your-server-address [: port] /v3/index.json

Publisher:

 dotnet nuget push -s http(s)://your-server-address[:port]/v3/package package.nupkg 
+2
source

I had the same problem and did some research. You may have already solved your problem, but here NuGet lists several alternatives to explore; both free and paid: Hosting your own NuGet channels

In short list

  • Team Visual Studio Services
  • Myget
  • Inedo proget
  • Jfrog artifactory
  • NuGet Server
  • Sonatype nexus

I just tested ProGet, but it doesn't seem to update with v3 even if it is easy to install and release.

I can just switch to my native TeamCity as soon as they get the opportunity to handle v3 channels.

I am currently testing a NuGet server that can be downloaded as a package through

 Install-Package NuGet.Server 

in the package manager in Visual Studio in a new, empty web application for .Net 4.5.x.

+1
source

I checked some products, and my favorite is Azure DevOps Services .

Azure DevOps Services

βœ… free (2 GB of storage included)
βœ… support characters
βœ… website with search

BaGet There is currently no stable production version (September 2019)

βœ… free
βœ… support characters
βœ… website with search

NuGet Server

βœ… free
❌ support characters
❌ website with search

Myget

❌ free
βœ… support characters
βœ… website with search

Inedo proget

❌ free
βœ… support characters
βœ… website with search

Jfrog artifactory

❌ free
βœ… support characters
βœ… website with search

Sonatip Nexus

❌ free
❌ support characters
βœ… website with search

Migration script

 $source = "http://oldnuget-server.mydomain.com/nuget" $destination = "https://pkgs.dev.azure.com/MYCOMPANY/_packaging/MYCOMPANY/nuget/v3/index.json" (& .\nuget.exe list -AllVersions -Source $source).Split([Environment]::NewLine) | % { $id = $_.Split(" ")[0].Trim() $version = $_.Split(" ")[1].Trim() $path = [IO.Path]::Combine("Packages", $id, $version, "${id}.${version}.nupkg") Write-Host "nuget.exe push -Source $destination ""$path""" & .\nuget.exe push -Source $destination $path -ApiKey XXXX-XXXXX } 
0
source

Source: https://habr.com/ru/post/1235566/


All Articles