I am unable to install a package pushed to company source. In package manager I see the correct most up-to-date version but when I try to install it I get an error:
Package 'xxxx' is not found in the following primary source(s): 'https://company/nuget/v2/index.json,https://www.nuget.org/api/v2/'. Please verify all your online package sources are available (OR) package id, version are specified correctly.
The situation is strange because my colleagues are capable of installing this very package for the same project on their machines on the same version of code.
I resolved the error by removing ".vs" folder from the solution.
After 4 hours struggle I found solution here
https://www.grapecity.com/componentone/docs/uwp/online-getting-started/config-nugetpackage.html
Tools > Options > NuGet Package Manager > Package Sources. > Click add button and add following one by one
nuget.org
https://www.nuget.org/api/v2/
GrapeCity
http://nuget.grapecity.com/nuget
Related
I have made Python discord bots in the past with discord.py but now I am learning C# and I want to try to make one with discord.net. When I try to install discord.net - I click on dependencies, then NuGet packages, and then browse and search up discord.net. When I press the install button, I get the following error:
Severity Code Description Project File Line Suppression State
Error Failed to retrieve information about 'Discord.Net.Core' from remote source 'https://github.com/DSharpPlus/DSharpPlus/FindPackagesById()?id='Discord.Net.Core'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
I am using Visual Studio 2019.
The issue is that you have used a private nuget feed. In that feed, you have Discord.Net nuget package but some of its nuget dependencies such as Discord.Net.Core do not exist in your private feed. This is the cause of the problem. Remember that nuget dependencies are installed together with the nuget main package. If there is a problem with installing the dependencies, the main package cannot be installed in the project.
So I suggest you should use nuget.org nuget package source.
Suggestion
1) Tools-->Nuget Package Manager-->Package Manager Settings-->Package Sources
check nuget.org source and if your VS did not have it, you can add like this.
2) then under manage nuget packages UI, please select nuget.org to install that package.
============================================
Update 1
Close VS, delete nuget.config under C:\Users\xxx(current user)\AppData\Roaming\NuGet.
Then, restart VS and then installing nuget packages work well.
I got an error
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
while building my solution. Package manager can't restore my 2 projects:
Unable to find project information for 'C:\(...)\MultiLinker.Courier.Dext.Model.csproj'. The project file may be invalid or missing targets required for restore.
In tools I allow package manage to download packages:
Ran into the same issue. In my case, it was because Visual Studio only had the Offline Package source and could not resolve the packages I needed. I added in the nuget.org source as shown below in the NuGet Package Manager settings and right clicked on the solution and selected restore packages. and it resolved the issue.
open Nuget Package Manager -> Package Source > Add https://nuget.org/api/v2
I might be forgetting some steps, but a crucial step for me to fix this was running nuget restore from the commandline (Trying to restore from Visual Studio UI was not sufficient for some reason).
I also added a plugins folder given to me by a teammate to my .nuget folder that supposedly makes it handle our credentials automatically, so if you are having this issue maybe that is something you are missing as well.
In my case it was my Company DevOps credentials being out of date
Account Settings > Change credentials in the dialog that opens
On Visual Studio Code (VSCode) this can be solved this way:
dotnet new nugetconfig
thank you it works fine
and solved all issues of nuget
by creating the new value in the setting of nuget
under tools > nuget package manger > package manger settings
nuget package sources
add new value nuget.org and https://www.nuget.org/api/v2/
then save and update you project
it will work
The nuget restore did not work for me but once I used nuget.org it worked just fine. This was the best solution for me.
Upgrading my out of date Visual Studio helped for me:
Help Menu: Check for Updates...
Trying to install Microsoft.Azure.CosmosDB.Table version 1.1.3, but keep getting the error
Unable to resolve dependency 'Microsoft.Azure.Storage.Common'.
Source(s) used: 'nuget.org', 'Microsoft Visual Studio Offline
Packages'
My current project is from the Azure QnA bot template
Any help with this would be much appriciated!
Error installing Microsoft.Azure.CosmosDB.Table NuGet
This is a known issue on GitHub, if project is configured to use packages.config this issue will manifest itself.
And this issue is fixed for PackageReference. NuGet team are determining if needs to fix this for packages.config, or leave it as is.
Before add nuget package, go to Tools-Options->NuGet Package Manager->General, change the default package management format to PackageReference. Then restart the Visual Studio, reload your project, add that package.
If you still get the same error, please check following Troubleshooting:
Use Package Manage Console to install the Microsoft.Azure.CosmosDB.Table package and its dependencies. To do
this, type the following in the Package Manager Console for your
solution.
Install-Package Microsoft.Azure.CosmosDB.Table -IncludePrerelease
Using your preferred Nuget package management tool, install the Microsoft.Azure.Storage.Common Nuget package before installing
Microsoft.Azure.CosmosDB.Table.
Hope this helps.
After pulling some code updates I found I got this message when building.
Some NuGet packages are missing from the solution.
The packages need to be restored in order to build the dependency graph.
Restore the packages before performing any operations
In solution explorer the references links displayed with a missing reference icon
I deleted the references Then at the package manager console a button appeared asking if I wanted to install the missing packages. However, this did not work.
I am writing this answer as I tried the below solutions but none of them worked :
Clearing the cache
Restoring or re-installing the packages
Changing the targetFramework
Updating the Nuget Package manager
Then I looked upon a dropdown list and it appeared the error was trivial. The package source was offline !! I installed VS2017 professional on my system and opened an existing project and found that multiple packages were missing. I tried everything I could, without looking at Package Source !!
Solution:
Step 01. Go to Package Manager Settings (Tools > Nuget Package Manager > Package Manager Settings)
Step 02. Check the Package Source(s). As you can see, the package source is here already downloaded SDK/nugets/packages. I don't know the reason but the online package source from nuget.org was missing from my system installation of Visual Studio.
Step 03. Install the nuget.org as package source and then 'Clear All Nuget Cache(s)' and then restore the packages. The error will go away.
Name: nuget.org ( or as you wish)
Source: https://api.nuget.org/v3/index.json
When I tried opening the project on its own , outside the solution, and buidling it I received the message.
One or more NuGet packages need to be restored but couldn't be because consent has not been granted. To give consent, open the Visual Studio Options dialog, click on the Package Manager node and check 'Allow NuGet to download missing packages during build.' You can also give consent by setting the environment variable 'EnableNuGetPackageRestore' to 'true'.
I granted VS the permission, then I ran at the package manager console
update-package -Reinstall
Click Ctrl+Q and write the name of the missing package and then click search for online NuGet package matching .
It will show menu click on browse that will give you the missing package click install ,uninstall or update.
It's possible that folder/zips content error during the first download so go to the Xamarin folder (C:/User/YourName/AppData/Local/Xamarin) and delete or rename or move out the folder of missing nuget or content the of zips folder.
Restart the IDE, your IDE download again the content. I tried this and it works.
How it's possible that NuGet's Install-Package fails with Unable to find version 'x' of package 'y' when that exact version is released as NuGet to the official repository and it shown on the https://www.nuget.org/packages/y page.
Here is specific sample with nuget.org content and NuGet Install-Package command output.
UPDATE. Package sources are set to defaults (from nuget.org). Actually, you can see the issue just by running Install-Package Log4Net.Async -Version 1.3.0.
UPDATE 2. I want to highlight that it's not about some developer's machine - the same things happen on Visual Studio Online Hosted Build Controller.
UPDATE 3. Here is how NuGet tries to load package and it looks like NuGet API just broken, because all these requests fail with the error below.
Resource not found for the segment 'Packages'
Also NuGet produces a strange output on NuGet API calls that issued at VS search packages stage, please see here: http://pastebin.com/qveadrZB.
NuGet currently has some service issues related to search and package restore functionality. It is possible this is the cause of your package restore failure.
If other dev machines are working OK, it's likely they have access to a cached version of this package.
Clear your NuGet cache under options -> NuGet Package Manager
I know this thread is very old, but someone who has this problem like me in these days, find my solution for solving such problem here.
I've installed Visual Studio 2012/2015/2017 parallel, and 2012 failed with "package not found error".
So I take a look in the NuGet-settings in VS2017 and found the following package resource:
https://api.nuget.org/v3/index.json
I just added this location to the package resources and vĂ²ila, the searched packages where found and installed (in my example the HtmlRenderer).
But be careful with compatibility to Framework 2.0! This setting breaks maybe the functionality to version 2.0!!
Hope this helps someone sometimes somewhere.
Greetings
I'm a latecomer to this thread... I'm in Visual Studio 2017 - 15.9.4
I got this error today trying to pull from my private DevOps NuGet feed
CONTEXT:
the first time I called Install-Package everything worked, but, my NuGet was not assembled right, so, I re-published the NuGet pkg, and
when I tried to update my project that was consuming the pkg, that's
when I got the failure)
Switching my Package Source to "all" alleviated the problem.
After 4 hours struggle I found solution here
https://www.grapecity.com/componentone/docs/uwp/online-getting-started/config-nugetpackage.html
Tools > Options > NuGet Package Manager > Package Sources. > Click add button and add following one by one
nuget.org
https://www.nuget.org/api/v2/
GrapeCity
http://nuget.grapecity.com/nuget
NuGet settings in Visual Studio
Right click on references in your project
Manage NuGet Packages => All
Uninstall affected packages
If this does not resolve the issue, try to remove it from the NuGet config file located at
C:\Users\UserName\AppData\Roaming\NuGet\NuGet.config