0
votes

I am using nexus OSS 3.15.2-01 and its new instance. Issue we are facing is with nuget proxy repos, if i try it manually curl nuget org on nexus server it reaches the URL. but when i try to download it from VS or from cmd it says file not found.

I have created a seperate blob for nuget and new repo nuget_gallery, and provided the nuget org in proxy configuring it but its not working

From VS it says,

Severity Code Description Project File Line Suppression State Error The feed ‘nexus prod [repo URL]’ lists package ‘Microsoft.AspNet.WebApi.Client.5.2.7’ but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again. Unable to find package ‘Microsoft.AspNet.WebApi.Client.5.2.7’.

How ever the version is fetched in nexus if we browse the repo but even when we try to download it says file not found (0 bytes)

2

2 Answers

0
votes

You can try tips below to check if it helps:

1.Clean all the NuGet package cache by the command line: nuget locals all -clear.

2.Close all Visual Studio instance, then delete nuget.config file in the location: C:\Users\xxx\AppData\Roaming\NuGet\NuGet.Config, then re-open the Visual Studio to restore nuget packages.

3.Check if there is a firewall policy or other proxy settings that block the nuget installation package.

And please check if the issue only occurs when featching packages from Nexus or it also occurs when you download packages from nuget.org. Maybe you can get some help from this thread.

0
votes

Bit late to the party, but I had this same problem. It seems to be down to lack of NuGet protocol 3 support in Nexus.

Workaround was to add protocolVersion="2" to my nuget.config like this;

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />

    <add key="your-nexus-repo" value="http://your-nexus-repo/nexus/service/local/nuget/your-repo-name/" protocolVersion="2"/>
  </packageSources>
</configuration>

I still had problems with dotnet core 3 packages, so also had to add back nuget.org (or remove <clear/> if nuget.org is in your global config)

<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />