Nuget cli with Nexus 3 OSS always getting 404 - nuget

I am trying to download Nuget packages through Nexus 3 OSS Nuget proxy repository that I just created.
Nexus: OSS 3.30.1-01
NuGet Version: 5.8.1.7021
I created Nuget proxy repository:
http://127.0.0.1:8081/repository/nuget-prx/
source for this repository is https://api.nuget.org/v3/index.json
When running Nuget cli through Nexus:
C:\Nexus>nuget install jquery -source http://127.0.0.1:8081/repository/nuget-prx/
Feeds used:
http://127.0.0.1:8081/repository/nuget-prx/
Installing package 'jquery' to 'C:\Nexus'.
GET http://127.0.0.1:8081/repository/nuget-prx/FindPackagesById()?id='jquery'&semVerLevel=2.0.0
OK http://127.0.0.1:8081/repository/nuget-prx/FindPackagesById()?id='jquery'&semVerLevel=2.0.0 1138ms
Unable to find package 'jquery'
When running direct against official Nuget repository:
C:\Nexus>nuget install jquery -source https://api.nuget.org/v3/index.json
Feeds used:
https://api.nuget.org/v3/index.json
Installing package 'jquery' to 'C:\Nexus'.
GET https://api.nuget.org/v3/registration5-gz-semver2/jquery/index.json
OK https://api.nuget.org/v3/registration5-gz-semver2/jquery/index.json 519ms
Package "jquery.3.6.0" is already installed.
I already tried to switch to Nuget v2 protocol. The result was pretty similar.
What I am missing?
Any ideas will be appreciated!

Solved. Request should be: C:\Nexus>nuget install jquery -source http://127.0.0.1:8081/repository/nuget-prx/index.json

Related

Download Nuget Package using Nuget.exe

Im working on an automation solution for transfering nuget packages from nuget.org to a private nuget feed. Is it possible to download nuget packages using nuget.exe? If i run the following command, it fails because it tries to install it to the directory, but i dont need to install the package i just need to download it.
.\nuget.exe install Microsoft.AspNetCore.App.Runtime.linux-x64 -source nuget.org -force
This throws the following error:
Error NU5000: Package 'Microsoft.AspNetCore.App.Runtime.linux-x64 7.0.1' has a package type 'DotnetPlatform' that is not supported by project 'C:\foo'.
I am looking for something like a -force option, so that i can just download the package without installing it.

Installing Nuget Gets Dependencies Only

I have a .NET Framework 4.5 project. I'm trying to install Microsoft.NET.Test.Sdk. This should be possible as per https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/
I ran the following command, but get the dependencies only. I tried installing via the Nuget Package Manager too. Finally... I see the package inside my packages.config file, but don't see it in my references. Any suggestions?
Install-Package Microsoft.NET.Test.Sdk -Version 15.7.0
I ended up using Microsoft.VisualStudio.TestTools.UnitTesting.

Nuget Package Manager for single project fails to load after adding RingCentralSDK

I'm on VS 2015, targeting .net 4.5.2, my "Nuget Package Manager for Visual Studio" in Extensions and Updates shows 3.4.4.1321.
I added all dependencies of RingCentralSDK package separately:
Microsoft.Bcl
Microsoft.Bcl.Async
Microsoft.Bcl.Build
Microsoft.Net.Http
Newtonsoft.Json
Portable.BouncyCastle-Signed
PubnubPCL
Then I right click on my project, pick "Manage Nuget Packages...", the tab opens, in the "Installed" subtab I can see the 7 packages.
Now, I install the RingCentralSDK package. My output is fine:
Attempting to gather dependency information for package 'RingCentralSDK.1.0.0' with respect to project 'MyProj', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'RingCentralSDK.1.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'RingCentralSDK.1.0.0'
Resolved actions to install package 'RingCentralSDK.1.0.0'
Adding package 'RingCentralSDK.1.0.0' to folder 'C:\code\packages'
Added package 'RingCentralSDK.1.0.0' to folder 'C:\code\packages'
Added package 'RingCentralSDK.1.0.0' to 'packages.config'
Successfully installed 'RingCentralSDK 1.0.0' to MyProj
========== Finished ==========
Now, I check again the Manage Nuget Packages for this specific project, and instead of seeing the list of packages, I get a yellow band:
Error occured Show erros in output Dismiss
And in the "Package Manager" output, the error is:
ZIP archive contains unsupported data structures.
In my packages folder, the folder "RingCentralSDK.1.0.0" seems ok, but then I don't anything about nuget packages format.
I cannot uninstall RingCentral via the package manager as it's not showing, not any other one, which is really annoying. I had an error when trying to do it via the command line. I reverted my changes (or remove the line in packages.config for my project), and the Nuget Package Manager tab works fine again. This is also affecting the "Managet Nuget Packages for Solution".
What can I do to fix this?
Fixed in RingCentralSDK 1.0.1-alpha1
It turns out that the NuGet package created on Mac is not compatible with Visual Studio NuGet GUI tool.
You can install the latest version by
Install-Package RingCentralSDK -Pre
Or if you prefer GUI:
Update:
For projects which already have 1.0.0 version installed, how to upgrade?
Today I did some testing and I came to the following conclusion:
New project will have no problem with 1.0.1 version or later
For old project which have 1.0.0 installed. You need to follow the following steps:
UnInstall RingCentralSDK 1.0.0
Close VS
Delete packages folder in your project
Delete packages folder in ~/.nuget/
Launch VS
Install RingCentralSDK 1.0.1
I need to do the above because nuget has cache. If I don't do it the problem just persists. I don't know the exactly reason but the above steps did work for me.

Build a C# project fails in nuget restore package Microsoft.ApplicationInsights

I have this Azure Notification Hubs Sample
and it fails because
The 'Microsoft.ApplicationInsights 0.12.0-build17386' package requires
NuGet client version '2.8.50313' or above, but the current NuGet
version is '2.8.1.0'. The command "eval nuget restore
src/NotificationHubSample.sln" failed. Retrying, 2 of 3.
why?
It is a problem with the Microsoft.ApplicationInsights NuGet package. In its .nuspec file it has the following:
<metadata minClientVersion="2.8.50313">
NuGet will check the minClientVersion defined by a NuGet package against its product version to see if they are compatible.
The minClientVersion used in the Microsoft.ApplicationInsights NuGet package seems to be using the NuGet assembly file version and not the NuGet product version. So NuGet restore or install will always fail, at least until a newer version of NuGet is released. The latest NuGet released has a product version of 2.8.3.
Note that I am ignoring NuGet 3.0 which currently has a CTP release. So this NuGet package would work with NuGet 3.0 so maybe the creators of the Microsoft.ApplicationInsights NuGet package have only tested it with that version.
So your options are:
Report the problem to the owners of the Microsoft.ApplicationInsights NuGet package and wait for them to fix it.
Use NuGet.exe 3.0 to run the package restore with Travis.
Use a different version of the Microsoft.ApplicationInsights NuGet package which does not have this minClientVersion restriction.

nuget local package source is unable to find package

I'm trying to build some packages for use within my company. I've set up a local folder on my hard drive and added it as a package source before the official nuget source. when I execute nuget list janney, my packages are found however executing install-package janney.myfirstpackage throws an error Install-Package : Unable to find package 'Janney.MyFirstPackage'.
What am I doing wrong? Is this an indication that I've messed up my packages?
In my package manager console my package source was set to nuget rather than all