I have Visual Studio 2019 Commmunity edition. Whenever I download any package from Nuget Package Manager -> Manage Nuget Packages for Solution, it throws an error
NuGet.Protocol.Plugins.PluginException: A plugin was not found at path
'C:\Users \ (Current Username)\ .nuget\plugins'
I can't download any packages even when I create new empty project.
I get the same error even when I use the
Install-Package
command. Please help
Answering my own question :
I realized that there is something called
NUGET_PLUGIN_PATHS
in environment variables. It was pointing to my 'C:\Users \ (Current Username)\ .nuget\plugins' directory . I deleted that environment variable and guess what ? It started downloading packages from nuget.org using Install-Package command. It took me 2 days to find this solution.
Related
So I am using Visual Studio 2022 on Windows 11. I am trying to install a nuget package.
I get the message The package at 'Path' failed to uninstall.
So I restart and guess what - it makes no difference. Its not a re-install so the package isnt already there. It does create the folder and contents in the packages folder. I have closed VS and manually deleted it. The same package works fine in another project!
Anybody any ideas how I move this forward?
Thanks in advance.
According to your description, you can try the following methods.
Go to Tools>Options>NuGet Package Manager>General and Clear All NuGet Cache(s).
Restore package.
Reinstall package.
Check your package.config file for package dependencies.
Today I want to install Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package.
But it turns out I get bad request for
https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.razor.runtimecompilation/5.0.10/microsoft.aspnetcore.mvc.razor.runtimecompilation.5.0.10.nupkg
And it said
"The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.5.0.10' 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.AspNetCore.Mvc.Razor.RuntimeCompilation.5.0.10'."
I have checked that package source is from
https://api.nuget.org/v3/index.json
Does anyone know how to fix this problem?
You might want to look at the answer here.
Just like Leo Liu-MSFT said:
Clean the entire NuGet package cache by the command:
nuget locals all -clear
Close all Visual Studio instances, delete the nuget.config file in the location:
C:\Users\leoliu\AppData\Roaming\NuGet\NuGet.Config
and then reopen Visual Studio to restore NuGet packages.
Check if there is a firewall policy or other proxy settings that is blocking the NuGet installation package.
I have a large project that has about a dozen dependencies. I have tried to install them all but ran into an error from VS. I am using Visual Studio 2015
"An error occurred while trying to restore packages: Unable to find version '3.0.3.1' of package'Lucene.Net.Core'."
Now I have a solution which I can use that is by the same name as this package, but VS refuses to let me updates, remove, or change ANYTHING related to these packages and asks that I restore the packages. I am entirely lost here friends, what should I do?
P.S. the two sources I am using for my package sources are:
https://www.nuget.org/api/v2/
https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/
The same error occurs for Lucene.Net.Contrib, pstsdk.net, and various packages.
One thing to check for is if your project is built on a version of the NET framework that is less than or equal to the target framework the package has.
If your project is a NET 4.5 based project, but the nuget package has a NET 4.5.2... then the package manager will error out.
"An error occurred while trying to restore packages: Unable to find version '3.0.3.1' of package'Lucene.Net.Core'."
When I use the packages sources which you provided, I found that only two versions (4.8.0 & 4.9.0) of package"Lucene.Net.Core" not have the version '3.0.3.1'.
Pay Attention:
I noticed that the author of this package have updated this package at March 11, 2017(3/11/2017), and only release the version 4.8.0 & 4.9.0. So this must be the reason for NuGet restore failed.
Besides, you said:
I have a solution which I can use that is by the same name as this
package, but VS refuses to let me updates, remove, or change ANYTHING
related to these packages
If you want to remove those error packages, you can try to use below command to force uninstall those packages:
Uninstall-Package Lucene.Net.Core -Force
Or you can delete this package from the package folder and delete the package list from the package.config.
Then install the correct version of the packages.
Although I was not able to get any of the posted answers to work, I ended up removing the project entirely and reinstalling VS, my project, and its dependencies. This ended up working.
Another thing to check is that the package manager configuration settings in visual studio list the public nuget feed (and if the feed is enabled too).
I need to install Nuget Package ProductionStackTrace, so I use the following command
PM> Install-Package ProductionStackTrace
But when I execute this command I get the following error
The source at Microsoft Visual Studio Offline Packages [C:\Program Files (x86)\Microsoft SDKs\NuGetPackages] is unreachable.
I checked the path and yes the package is not there; isn't Nuget Package added by default? If not, from where I can add it?
Visual Studio provides some common packages for us to use in the Microsoft SDKs\NuGetPackages folder when our computer doesn't have network.
The C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ folder is not means that the cache for the packages has been installed before from internet. So the package ProductionStackTrace will not add into this folder.
If you want to use this package without network, you need to download it when you have network. You can download it from the nuget.org.
Certainly, you can also add this package in to the Microsoft SDKs\NuGetPackages so that you can use it when you do not have a network. The add command line is:
nuget add <packagePath> -source <sourcePath> [options]
You can refer to the nuget Add reference for detail.
Hope this can help you.
Unclear why this happened for my installation, but Visual Studio (VS 2022 preview at this time) had an offline location (good), but no package source to nuget.
This caused my build to fail on packages not found in the offline directory.
Hence I ended up adding a Package source in Visual Studio for Nuget as:
nuget.org
https://api.nuget.org/v3/index.json
Which then allowed VS to do a Restore of packages to succeed. Then not having to do a nuget install Newtonsoft.json -source ... type command for each failed package.
for Visual Studio Mac, packages are copied into the path /Users/{username}/.nuget/packages
You can choose menu for Visual Studio->Preferences->Nuget->Sources and add a new source using this path and install already cached packages.
manually dowload from nuget.org package with extension NUPKG file,and copy paste that into (C:\Program Files (x86)\Microsoft SDKs\NuGetPackages) relative path
OR
RUN CMD COMMAND:
dotnet add projectpath package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore --version 6.0.0
Good Day eveyone. I'm currently installing Xamarin.Forms Nuget Package but I repeatedly get this error whenever I trying to to install it.
Failed to retrieve information from remote source 'http://nuget.syncfusion.com/xamarin/FindPackagesById()?id='Xamarin.Forms''
I was able to install other packages but not this one. How can I solve this? Here's my printscreen.
What version of nuget are you running. You may need to try updating NuGet.
If that does not work or it is already updated, try to install the NuGet package using the Visual Studio Package Manager Console instead: In Visual Studio -> View -> Other Windows -> Package Manager Console
Then type: Install-Package PACKAGENAME -ProjectName PROJECTNAME You may need to repeat that for each project you want to install the package into.