Reputation:
I am installing MySql.Data
in Visual Studio 15 using nuget Console
. I am getting the following error
Install-Package : An error occurred while retrieving package metadata for 'MySql.Data.6.9.9' from source 'nuget.org'.
At line:1 char:1
+ Install-Package MySql.Data -Version 6.9.9
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I don't know what is the problem.
Any help would be highly appreciated.
Upvotes: 3
Views: 5743
Reputation: 107247
For future readers - I had a similar issue installing MySql.Data version 6.10.4
(marked latest stable as at Nov 2017) into a .Net 4.5 project. I received no error on the NuGet Package Manager console, and could see that the package had been downloaded into /packages
, however there was no assembly reference added in the project.
Looking closely however, the package lib targeted 4.52
So you'll either need to upgrade the .Net project version to 4.52 or beyond, or downgrade to an earlier version of MySql.Data
Install-Package MySql.Data - Version 6.9.10.0
Upvotes: 8
Reputation: 76760
Unable to install MySql.Data in Visual Studio using nuget
With a design by NuGet v3. If one package source is invalid or is failing then it is not possible to install or update a NuGet package when all package sources are being used. So you need to check the package source from Tools -> Options -> NuGet Package Manager -> Package Sources first. Make sure the package source is correct. (you can unable other package sources except nuget.org). The source of nuget.org is "https://api.nuget.org/v3/index.json
"
Or you can try to add another one with the URL on API v2 of the NuGet.org:
The source of nuget api v2 is "https://www.nuget.org/api/v2/
".
Besides, if above not help you. Please check you NuGet Packager Manager version: Go to VS menu Tools
> Extensions and Updates
> Updates
and check if there is no updates for NuGet Package Manager. Installing the latest version.
Below method may be optional:
In Explorer open folder where your project resides. Open packages.config using Notepad. Find and remove the line that mentions corrupted package name. Then Open folder where your solution resides. Open subfolder "packages". Find folder with corrupted package and remove it. Try to install that package again.
Hope this help.
Upvotes: 0