I get NuGet error when trying to install any package - visual-studio

I'm making a Windows form progect in Visual Studio.
When I trying to install any package through console I get error
Install-Package : Unable to find package 'PackageName' at source ''.
I tried both Visual Studio 2013 and Visual Studio 2019.
When I go to Nuget Browse I get error as well. I don't see any packages

According to your description, you can check your package scources under Tools > Options > NuGet Package Manager if you don’t have the correct package sources you can add this “https://api.nuget.org/v3/index.json” such as:

Maybe try to add -source "https://api.nuget.org/v3/index.json" behind?

Related

Visual Studio Nuget manager does not show OpenTK package

I am trying to add OpenTK as a dependency. When I open the Nuget Package Manager, the only Package source displayed is "Microsoft Visual Studio Offline Packages", so I went to Tools > Options > Nuget Package Manager > Package Sources and added the package source:
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
I now get the following list of packages, but the OpenTK package is not there.
As a solution to installing packages that do not show up on the Nuget manager GUI, I can use the Package Manager Console which finds OpenTK without problem.
PM> Install-Package OpenTK
Maybe this is the package you need:
You can check if your scroll wheel is on the top and if there is any package you missed

How to install syncfusion javascript using nuget from visual studio community 2022 and visual studio code?

I tried the link here
https://www.nuget.org/packages/Syncfusion.JavaScript/
Install-Package Syncfusion.JavaScript -Version 19.4.0.47
From inside VS 2022 community I can not find nuget GUI so I used the console and I get this
I tried from nuget.exe and get this
I tried in vs code I pressed Ctrl+Shit+P and typed nuget to install nuget GUI but nothing found. What I should do ?
To install the NuGet packages in Visual Studio through package manager Console, run the command under Package Manager tab.
Install-Package Syncfusion.JavaScript -Version 19.4.0.47
install-package-visual-studio
To install NuGet packages in the Visual Studio Code, please run the below command in the Visual Studio Code terminal which is under .NET CLI tab in the nuget.org
dotnet add package Syncfusion.JavaScript –version 19.4.0.47
install-package-vscode
For more details to install NuGet packages in the application, please refer the below link:
https://ej2.syncfusion.com/aspnetcore/documentation/nuget-packages/

Visual Studio 2017 Professional- Unable to find package at source

I was trying to add package through nuget package manager=> package manager console and from Manage Nuget packages from solution directly. I am trying to install Newtonsoft.Json from Package Manager Like this Install-Package Newtonsoft.Json but unable to find from the source i.e
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
This gives me result like this:
PM> Install-Package Newtonsoft.Json
Install-Package : Unable to find package 'Newtonsoft.Json' at source ''.
At line:1 char:1
+ Install-Package Newtonsoft.Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:01:30.2571879
I think that the source here is blank. May be because of that it is unable to load packages. I have tried to manage the package manager setting but not been able to connect. My package manager setting is like this:
Despite of having good connection of internet I am not been able to install package. My questions are:
How should I install package?
What am I doing wrong to install package?
Assuming you are using Windows OS
Have you initialised vs 2017 after installation or Have you updated your vs 2017?
If not then please initialized it.
Restart your PC.
Open your project in vs 2017
Check your nuget package manager settings.
Name:nuget.org
Source:api.nuget.org/v3/index.json
Now, run nuget package manager from tools=>Nuget Package Manager=>Package Manager Console and write your install-package command or run Manage nuget package manager for solution from tools=>Nuget Package Manager=>
Hope,it helps you.
Your VS 2017 is probably using some kind of proxy setting which is preventing it from accessing the internet.
To check if VS can access internet try opening any web page from within VS Browser. If you cannot browse then my hunch is correct.
Solve the proxy issue and you should be fine.
Hope it helps.
I resolved this issue by adding nuget.org which was missing in my package source.
Go to Tools>Nuget package manager>Package Sources>
Click Plus sign >
Name: nuget.org
Source : https://api.nuget.org/v3/index.json
Now your Visual studio will be connected to Internet and package will be downloaded successfully.

VS2017 Metadata file '.dll' could not be found

After upgrading to Visual Studio 2017, I am unable to build my project. Visual Studio 2015 still works when pointing at the exact same project.
this is the build errors I get Metadata file '******.dll' could not be found
I've already tried https://stackoverflow.com/a/17723774/3511012 with no success
I tracked the issue down to a specific NuGet package that has not yet been updated for visual studio 2017. (Baseclass.Contrib)
It isn't yet registered as having updates available through the nuget package manager, but you can manually update using the nuget console and running this command Install-Package Baseclass.Contrib.Nuget.Output -Version 2.3.0-vs20172

Build errors with Visual Studio Online

After a check in from Visual Studio 2013 I am getting the following 2 build errors:
C:\a\src\project.nuget\nuget.targets (58): The process cannot access the file 'C:\Users\buildguest\AppData\Roaming\NuGet\NuGet.Config' because it is being used by another process.
C:\a\src\project.nuget\nuget.targets (58): The command ""C:\a\src\project.nuget\nuget.exe" install "C:\a\src\project\WebWorkerRole\packages.config" -source "" -o "C:\a\src\project\packages"" exited with code 1.
Do you have enabled NuGet Package Restore in your solution? This adds nuget.exe and nuget.config into your solution and build can use it locally. To enable NuGet Package Restore right click on the Solution node in Solution Explorer and select Enable NuGet Package Restore (see NuGet documentation).

Resources